MySQL command line export database:
First go to cmd and then:
1. CD C:\Program Files (x86) \mysql\mysql Server 5.1\bin
2. mysqldump-uroot-p labos1502 > Labos1502.sql
3. 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: Then empty a grid after mysqldump-uroot-p ABC plus--skip-lock-tables
4. You will see the file Labos1502.sql automatically generated under the bin file?
================ Command window to copy things, first with the mouse tag, and then CTRL + C copied into the text;
================ to the command window paste things, first copy, with the mouse sticky into it;
MySQL command line Import Database:
1. The labos1502.sql file to be imported is moved to the bin file, such a path is more convenient
2.1th step with the above export
3.mysql-u root-p (input will also let you enter the MySQL password)
4, create the database you want to build in Mysql-front, and specify the character set, this is an empty database, such as a new target database named News
CREATE DATABASE labos1502 DEFAULT CHARACTER SET UTF8 COLLATE utf8_general_ci;
show databases; Note that you must add a semicolon in English after the cmd window is running.
5. Create a database character set for a specified database
CREATE DATABASE labos1502 DEFAULT CHARACTER SET UTF8 COLLATE utf8_general_ci;
6, Input: Mysql>use target database name Mysql>use labos1502;
7. import file: Mysql>source the name of the import, as I entered the command line: Mysql>source labos1502.sql;
MySQL backup and restore is done using the mysqldump, MySQL, and source commands.
MySQL export database with command line