Usemysqldump Command
Backup:
# mysqldump -u root -p test > mysql_backup_201411202.sql
follow the prompts to enter the password, which willTestdatabase All table structure and data backup tomysql_backup_201411202. SQL, if the amount of data is large, you canUsegzipto compress the data, the command is as follows:
# mysqldump -u root -p test | gzip > mysql_backup_201411202.sql.gz
Backup to a remote machine, using - H specified, such as
# mysqldump -u root -p test > mysql_backup_201411202.sql -h xxx.xxx.xxx.xxx
can be backed up directly toIPaddress isxxx.xxx.xxx.xxxof the remote computer.
when the system crashes, rebuilds the system, or recovers the database, you can recover the data like this:
# mysql -u root -p test < mysql_backup_201411202.sql
To restore directly from a compressed file:
# gunzip < mysql_backup_201411202.sql.gz | mysql -u root -p test
Online data collation
From for notes (Wiz)
Backup of MySQL