First, the win system MySQL backup and restore:
1, Backup:
Start-and-run->cmd, go to the MySQL Bin folder:
Mysqldump-u user name-p databasename >exportfilename
Enter a password to export the database.
2, Restore:
Enter the MySQL command line, "Mysql>", to create the database to restore:
Create Database Databasesname;
Go to the database you created, and restore:
Use Databasename;source exportfilename;
Ii. MySQL backup and restore under Linux:
1, Backup:
# mysqldump-u Root-p Databasename>exportfilename.sql
Enter a password to export
2, Restore:
Method 1:
Go to MySQL console and restore using Source:
Mysql>create database Databasename;mysql>use Databasename;mysql>source exportfilename;
Method 2:
To restore using the MySQL command in the shell command line:
Create the database First:
Mysql>create database databasename;mysql>exit;# mysql-u root-p databasename <exportfilename
Enter a password to import
Third, MySQL export the specified table:
# mysqldump-uroot-p DatabaseName Table1>table1.sql
This article is from the "Baiyubao blog" blog, make sure to keep this source http://baiyubao.blog.51cto.com/2845008/1755095
MySQL Backup and restore (Win system +linux system)