This article from csdn ucser, http://blog.csdn.net/perfectpdl reprinted to indicate the source, thank you!
1. Import an SQL file to the database:
To use the source command, you must first log on to the MySQL Console
Mysql-u-p
Use xxxdatabase;
Source/test. SQL
2. Export the database table structure to the SQL File
Mysqldump-u root-p-D dbname> dbname. SQL
If you only want to export a database table, add the table name after the database name. Separate multiple tables with spaces.
3. Modify the MySQL password
Mysqladmin-u username-P old Password New Password
4. Connect to the MySQL database
Mysql-H host address-u user name-P User Password
5. Create a database, create a table,
Create Database database name;
Create Table Name
6. Delete databases and tables
Drop database database name; drop table name
7.Clear records in the table
Delete from table name;