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

What is the basis of mysql replication?

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

Share

Shulou(Shulou.com)05/31 Report--

mysql replication basis what, I believe that many people without experience at a loss about this, this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

View only the contents of the first binlog file

mysql> show binlog events;

View binlog files currently being written

mysql> show master status\G

Get binlog file list

mysql> show binary logs;

View the contents of the specified binlog file

mysql> show binlog events in 'mysql-bin.000002'

mysql-bin.index

Once binary logging is enabled, the server generates a file with the same name as the binary log file, but ending with.index. It is used to track which binary log files exist on disk.

MySQL uses it to locate binary log files.

mysql-relay-bin.index

This file functions similar to mysql-bin.index, but it targets relay logs rather than binary logs. It reads as follows:

.\ mysql-02-relay-bin.000017

.\ mysql-02-relay-bin.000018

1.FLUSH TABLES WITH READ LOCK

This command is a global read lock. After executing this command, all tables in all libraries are locked read-only. Generally used in database online backup, this time the database write operation will be blocked, read operation smoothly.

Read_Master_Log_Pos records the current master binlog file and location read by IO thread

Exec_Master_Log_Pos records the file and location of SQL thread execution to master binlog

Relay_Log_Pos records the end position of the event executed by SQL thread in relay log, which is the offset of relay log.

Relay_log and binlog are basically the same, the biggest difference is that end_log_pos records the location of the event in the binlog file of master

After reading the above contents, do you have any methods for mastering mysql replication bases? If you still want to learn more skills or want to know more related content, welcome to pay attention to the industry information channel, thank you for reading!

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