1. MySQL 5.1 Reference Manual2. Basic Tutorials
3, commonly used examples into the following:
1 Connect to the database:MySQL-H Host Address-u user name-P user password2 Prompt for database:MySQL> 3 Exit Database:Exit(carriage return)4Display database: show databases;5CREATE database: Create library name;6 Select database: Usedatabase name;7Show tables in the database: show tables;8display the structure of the data table: Describe table name;9 Build Table: Create TABLE table name (field set list); Note: auto_increment self-increment primaryKeyPRIMARY Key10 Display records in table: SELECT *from table name;11 Add record: INSERT into name (Uname,gender,birthday) VALUES (' Zhang San ', ' Male ', ' 1971-10-01 '));12 Modify Record: Update name set birthday= ' 1971-01-10 ' where Uname= ' Zhang San ';13 Delete Record: Delete from name where Uname= ' Zhang San ';14Delete tables: drop table name;15Delete Library: drop database name;16 Backup database: Mysqldump-u root-p--opt database name > backup name;//go to library directory17 Recovering the database:MySQL-U root-p database name < backup name;//database must exist at restore time, can be an empty database18 Authorization Database: Format: Grant SELECT on database. * To User name @ login host identified by "password";