MySQL Database Backup command mysqldump-hhostname-uusername-ppassword databasename> backupfile. SQL
Back up the MySQL database in the format of a table with deletion
Backing up a MySQL database is in the format of a table with deletion, so that the backup can overwrite existing databases without the need to manually delete the original database. Mysqldump -- add-drop-table-uusername-ppassword databasename> backupfile. SQL
Directly compress the MySQL database and back up mysqldump-hhostname-uusername-ppassword databasename | gzip> backupfile. SQL .gz
Back up a MySQL database (some) Table mysqldump-hhostname-uusername-ppassword databasename specific_table1 specific_table2> backupfile. SQL
Back up multiple MySQL databases at the same time: mysqldump-hhostname-uusername-ppassword-databases databasename1 databasename2 databasename3> multibackupfile. SQL -www.2cto.com-
Back up the database structure mysqldump-no-data-databases databasename1 databasename2 databasename3> structurebackupfile. SQL
Backup all databases on the server mysqldump-all-databases> allbackupfile. SQL
Command for restoring MySQL database mysql-hhostname-uusername-ppassword databasename <backupfile. SQL
Restore the compressed MySQL database gunzip <backupfile. SQL .gz | mysql-uusername-ppassword databasename
Transfer the database to the new server mysqldump-uusername-ppassword databasename | mysql-host = *. *-C databasename
Author: DouglasLau