The MySQL command line is very powerful and can even be used to back up the database. The MySQL command line described below is used to back up the database. I hope it will help you.
Note: The mysqldump command is executed in the DOS mysql \ bin directory and cannot be executed in the mysql environment. Therefore, it cannot end with a semicolon. If you have logged on to mysql, run the exit command mysql> exit
1. MySQL command line to export the entire database
The exported files are stored in the mysql \ bin directory by default.
Mysqldump-u username-p Database Name> exported file name
Mysqldump-uroot-p123456 database_name> outfile_name. SQL
2. Export a table through the MySQL Command Line
Mysqldump-u user name-p database name Table Name> exported file name
Mysqldump-u user_name-p database_name table_name> outfile_name. SQL
3. Export a database structure from the MySQL Command Line
Mysqldump-u user_name-p-d-add-drop-table database_name> outfile_name. SQL
-D no data-add-drop-table add a drop table before each create statement
4. Export with language Parameters
Mysqldump-uroot-p-default-character-set = latin1-set-charset = gbk-skip-opt database_name> outfile_name. SQL
MySQL permission table Introduction
Instances that grant MySQL user permissions
How to optimize mysql Indexes
How to view MySQL Indexes
Use of MySQL EXPLAIN statements