Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Considerations for the use of mysqldump

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The following content mainly brings you matters needing attention in the use of mysqldump, the knowledge mentioned, different from books, is summed up by professional and technical personnel in the process of contact with users, has a certain experience sharing value, and hopes to bring help to the majority of readers.

Mysqldump

Master library: `--master- data` value: 1 or 2 in the case of traditional replication: specifying`-- master-data= 1` when backing up will record its own binlog file and position records in the backup SQL file in the form of change master to MASTER_LOG_FILE = 'master_log_name', MASTER_LOG_POS = master_log_pos. You can import this backup file directly when making a new slave. You can connect yourself to the main library. If you specify `--master-data= 2`, this statement will be commented out and can be used to restore the main library. * * require * *: reload permission, and enable binlog * * Note * *: when you specify this option, you will open `--lock-all- tables` and continue the entire backup process (used to create a consistent backup environment). However, if `--single- transaction` is also specified, a global lock will be added only when the backup is started. The value from the library: `- dump- slave`: 1 or 2. The meaning of the value is the same as`-- master- data` and similar to the above `--master- data`. The change master to statement will also be generated, but unlike the MASTER_LOG_FILE and MASTER_LOG_POS obtained from the show master status executed on the main database, the two parameter values of Relay_Master_Log_File and Exec_Master_Log_Pos are obtained through show slave status from the library. And write it as MASTER_LOG_FILE and MASTER_LOG_POS to the backup file * * other * *: Relay_Master_Log_File: the master library binlog file Exec_Master_Log_Pos that contains the recent events (event) executed by the SQL thread of the slave library: the location of the transaction just executed by the SQL thread of the slave library in the binlog file of the master library being used by the slave library. When multiple slave thread is opened from the slave library, the execution progress of each thread may be different. According to the bucket effect, this value takes the oldest position in each thread * * in principle * *: after using this parameter, the backup tends to use the transaction coordinates of the master database rather than the transaction execution coordinates of the slave library itself. Moreover, when this parameter is used with `--master- data` at the same time, the`-- master- data` parameter is automatically masked. However, when GTID replication is enabled from the library and autoposition is enabled, neither `--master- data` nor`-- slave- data` parameters should continue.

Use, use GTID as the coordinate of the transaction. Specify `--single- transaction` directly

For the above notes on the use of mysqldump, if you need to know more, you can continue to pay attention to the innovation of our industry. If you need professional answers, you can contact the pre-sales and after-sales on the official website. I hope this article can bring you some knowledge updates.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report