Local:
1. Go to the Bin folder in the MySQL directory: e: Enter;
E:\>CD Mysql\bin? Enter
2. Export database: Mysqldump-u user name-p database name > exported file name
Example: Mysqldump-u root-p ABC > ABC. SQL (export database ABC to ABC. SQL file) When prompted for a password, enter the password for the database user name (if you export a single table, enter the table name after the database name)
If you are prompted locktable error: Mysqldump-u root-p ABC followed by an empty grid plus --skip-lock-tables
3, you will see the file news. is SQL automatically generated under the bin file?
MySQL command line Import Database:
1, which will be imported. The SQL file is moved to the bin file, which makes the path easier
2, the 1th step with the above export
3, enter mysql:mysql-u user name-p as I entered the command line: Mysql-u root-p?? (The input will also let you enter the MySQL password, Note: Log in to other databases, and then switch the database )
4. Create the database you want to build in MySQL, this is an empty database, such as a new target database named News
5, Input: Mysql>use target database name as I entered the command line:Mysql>use news;
6, import file: mysql>source import filename; As I entered the command line:Mysql>source news. SQL;
MySQL backup and restore is done using the mysqldump, MySQL, and source commands.
MySQL Backup and restore