MySQL5.6 backup mysqldump (i)

Source: Internet
Author: User

usage:mysqldump [OPTIONS] database [tables]
OR mysqldump [options]–databases [OPTIONS] DB1 [DB2 DB3 ...]
OR mysqldump [options]–all-databases [OPTIONS]
Use Mysqldump–help to view all command Help

The most commonly used parameter description: 1. --all-databases ,-a: Export all databases, including MySQL, Informance_schema, Performance_schema database example: mysqldump  -u root -ppassword -P3306 -S /tmp/mysql.sock --all-databases >  all.sql      or:      mysqldump -u root - Ppassword -p3306 -s /tmp/mysql.sock -a > all.sql2.--no-data, -d: Export the table structure of all databases, excluding data examples:mysqldump -u root -ppassword -p3306 -s /tmp/mysql.sock  --no-data --all-databases > 1.sql      or:      mysqldump -u root -ppassword -p3306 -s /tmp/mysql.sock -d -a  > 1.sql3.--databases , -b Export data for a database example: Mysqldump -u root -ppassword  -P3306 -S /tmp/mysql.sock --databases testdatabase > 1.sql      or:    &Nbsp;mysqldump -u root -ppassword -p3306 -s /tmp/mysql.sock -b  Testdatabase > 1.sql4.--add-drop-database: Add drop DATABASE statements before each database creation, use this option with caution, because when you import a database, you overwrite the existing database. This option is turned off by default. 5.--add-drop-table Add a Drop data table statement before each data table creation, the default is open, use--skip-add-drop-table to close the feature example: Cancel Add drop TABLE statement: Mysqldump -u  root -ppassword -p3306 -s /tmp/mysql.sock --skip-add-drop-table -- all-databases > all.sql6.--master-data  export with Master_log_file and master_log_pos  information, Example of initialization slave use:    mysqldump -u root -ppassword -p3306 -s /tmp/ mysql.sock --master-data --all-databases >  All.sql7.--single-transactioninnodb table when backing up, enable the option--single-transaction to guarantee the consistency of the backup, it works to set the isolation level for this session is repeatable  read to ensure that the data that has been submitted by other sessions is not seen when the session is backed up. The time of adding global read lock  is very short, can be understood as hot backup, It is strongly recommended to add the--single-transaction parameter when backing up with the mysqldump parameter.


This article is from the "12413959" blog, please be sure to keep this source http://12423959.blog.51cto.com/12413959/1883547

MySQL5.6 backup mysqldump (i)

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.