after MySQL is built under Linux, some common database commands are:
Creating a library: Create DATABASE MyDatabase;
Show all Databases list: show databases;
Delete database: Drop Dabatase mydatabase;
Make MyDatabase the current default database: Use MyDatabase;
Creating table: Create TABLE custmoers (userid int not null,username varchar (a) not null);
Delete tables: drop table cutomers;
Show table: Show tables;
Display table structure: DESC customers;
Insert a record into the Customers table: INSERT into Customers (Userid,username) VALUES (1, ' Hujiahui ');
Let the operation take effect immediately: commit;
Querying records in Customers: SELECT * FROM Customers;
Update the data in the table: Update customers set Username= ' licongying ' where userid=1;
Delete a record from a table: delete from customers;
Grant HJH user access to the database: Grant Select,insert,update,delete on *. * to Hjh@localhost identified by "123456", where Hjh is the user name
123456 is the password.
Login mysql:mysql-uhjh-p123456
Sina Weibo @ Leather likes playing basketball
Common commands for MySQL under Linux