mysql-uroot-p Password//Login
creat database people; Create
DROP database name//delete
Show databases//view all databases
use database name//using a database
Show tables//Show all tables under the current database
desc Table name//View the properties of the current table
CREATE TABLE Table name (//Creates a new table
Attribute Property data type remarks,
...
);
insert into table name (field 1, field ...). VALUES (field 1 values, ...) Insert
Select from * user; Querying all data stored in a table
Delete
from table name where id=2 (delete condition)//delete record in table by condition
Delete from
table name//Remove whole sheet
Update table name set element = .... where id=. Modify the record, without the where the entire table will change
Select Variable ..... from table name; Simple Query
select * FROM table name//Flexible query
SELECT * from user where name like '% King ' or password like '%123% '//query name with a king or password with 123
SELECT * from user limit 0,5; Fetch five records from the beginning
MySQL Database basic commands