MySQL database backup and restore common commands are the key to the MySQL database backup and restore, no commands, nothing to do, not to mention what backup restore, only to the system this command, let it go to perform, in order to complete the MySQL database backup and restore operations, The following are common commands for operations. One, backup command1, back up the MySQL database command mysqldump-Hhostname-Uusername-Ppassword databasename>Backupfile.sql2, backing up the MySQL database to a format with a delete table allows the backup to overwrite the existing database without having to manually delete the existing database. Mysqldump--Add-drop-table-uusername-ppassword Databasename>backupfile.sql3, directly compress the MySQL database backup mysqldump-Hhostname-Uusername-Ppassword databasename|Gzip>backupfile.sql.gz4, back up a MySQL database (some) table mysqldump-Hhostname-Uusername-Ppassword databasename Specific_table1 Specific_table2>Backupfile.sql5, backup multiple MySQL databases at the same time mysqldump-Hhostname-Uusername-Ppassword–databases databasename1 databasename2 Databasename3>Multibackupfile.sql6, just back up the database structure Mysqldump–no-Data–databases databasename1 databasename2 Databasename3>Structurebackupfile.sql7, back up all databases on the server mysqldump–all-Databases>allbackupfile.sql Second, restore command1, restore mysql database command MySQL-Hhostname-Uusername-Ppassword databasename<Backupfile.sql2, restoring the compressed MySQL database gunzip<Backupfile.sql.gz|Mysql-Uusername-ppassword databasename3, transfer the database to the new server mysqldump-Uusername-Ppassword databasename|Mysql–host=*.*.*.*-C DatabaseName
MySQL database backup and restore common commands