Common options and lock tables for mysqldump tools

Source: Internet
Author: User
Tags documentation

When I recently looked at the help documentation for the MySQL lock table, I found a bit of a problem with the lock table before using Mysqldump Backup, which was the mysql-a-bse "flush tables with read lock" when doing the backup script. Back to the official document know that this is invalid, because the flush tables with read lock, the statement after the MySQL session exit will be implicitly executed unlock tables, then flush tables with read lock; Only in the case of MySQL session does not quit when the opening of a session can be really effective, and in peacetime we manually back up when it is possible to do so, but if it is written script to do a scheduled backup, then it is not.

Finally, I went to see the next mysqldump document summarizes some of the more commonly used parameter options in Backup, of course, if you want to see all of the mysqldump's parameter options, check out the official MySQL documentation: http://dev.mysql.com/doc/ Refman/5.7/en/mysqldump.html, of course, there are some parameter options have version restrictions, there are usually used in more connection with the database when the parameter options, presumably know, here do not repeat, the commonly used parameters are as follows:

--add-locks# locks the Library table before dumping, and unlock after the end of the dump, this parameter option is more commonly used in backups--all-databases# dumps all library tables--lock-all-tables,-x# locks all library tables in the database. This Riga is read-only lock--lock-tables,-l# before dumps the lock table--flush-logs,-f# flushes the MySQL server log files before dumping--flush-privileges# Refresh the MySQL server's permissions table before dumping--routines,-r# in the dump database to store stored procedures (functions and programs), this if there is a defined timestamp will definitely use the--xml,-x #输出成xml格式--opt# It can give a quick dump operation and generate a dump file that can be loaded into the MySQL server quickly. This option is turned on by default, but can be disabled with--skip-opt--allow-keywords# allows you to create a keyword column name. The table name prefix should precede each column name

Of course, Mysqldump is the oldest backup and import tools in MySQL, usually backup there are a lot of tools to use, such as Mysqlbackup, Xtraback and so on, not listed here, and mysqldump is the default tool for MySQL, Then it also pursues the MySQL read configuration file my.cnf rules, MY.CNF will sequentially read from 4 paths sequentially, note that the following my.cnf will be compared with the previous MY.CNF content, such as the same options for different configurations or multi-out configuration, or overwrite the former, the my.cnf file read path is as follows:

/etc/my.cnf/etc/mysql/my.cnf/usr/etc/my.cnf~/.my.cnf# Finally, this is a hidden file in the home directory.


This article is from the "Technical essay" blog, please be sure to keep this source http://jim123.blog.51cto.com/4763600/1863929

Common options and lock tables for mysqldump tools

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.