MySQL database backup and restore common commands

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.