1, export the entire database MYSQLDUMP-U user name-p database name > storage location such as: Mysqldump-u root-p Project > c:/a.sql (export project database has been tested in person, success!) ) 2. Export the structure of a table with data in the table MYSQLDUMP-U user name-p database name Table name > exported file name Mysqldump-u Root -P project Position > c:/a.sql (test, Success!) Export only table structure without data in table: mysqldump -d -u root-p project position > c:/a.sql (test, Success!) ) 3. Export a database structure Mysqldump-u wcnc-p-D--add-drop-table smgp_apps_wcnc >d:wcnc_db.sql & nbsp -D No data--add-drop-table add a drop table 4 before each CREATE statement. Import Database 1, Common source command go to MySQL database console , d:/program files/mysql/mysql server 5.1/bin > Mysql-u root-p D:/program files/mysql/mysql Server 5.1/bin > Mysql>use ' database ' Then use the source command, followed by the script file (as used here. sql) d:/program files/mysql/mysql server 5.1/bin > Mysql>source d:wcnc_db.sql 2, mysql-uroot-p (password) database name Table name < imported file name 5. The remote Export Database command is as follows: Mys qldump-h 192.168.11.210 -u root -p test>c:/test.sql
MySQL database import and export