RESET MASTER
Delete all binlog files recorded in index file, empty the log index file, and create a new log file, which is usually used only for the first time when the master-slave relationship is built.
Attention
Reset master differs from the two places in purge binary log
1 Reset master Deletes all binlog files recorded in the log index file and creates a new log file starting value starting at 000001, whereas the purge binary log command does not modify the value of the order in which the records are binlog.
2 Reset master cannot be used in a master-slave relationship that has any slave running. Because the Reset Master command is not supported at slave run time, Resetmaster binlog the master from 000001 and slave The master log is the latest binlog of the main library at reset master. , the specified Binlog file cannot be found with the error from the library.
In MySQL 5.6.5 and later, RESET MASTER also clears the values of the gtid_purged system variable (known as gtid_lost into my SQL 5.6.8 and earlier) as as the global value of the gtid_executed (Gtid_done, prior to MySQL 5.6.9) system variable (but not it session value); That's, executing this statement sets each of the values to a empty string (")
RESET SLAVE
Reset slave will make slave forget the location information of the master-slave replication relationship. The statement will be used for a clean boot, which deletes the master.info and Relay-log.info files, as well as all the relay log files, and re-enable a new Relaylog file.
You must use the Stop slave command to stop the replication process before using reset slave.
Note that all relay log will be removed regardless of whether they are fully applied by the SQL thread process (which occurs when the standby latency is performed and the Stop slave command is executed in the repository), the Master.info file that stores the replication link information is immediately cleared if the SQL Thread is in the process of copying a temporary table, the stop slave is executed, and the reset slave is executed, and these replicated temporary tables will be deleted.
RESET SLAVE All
Reset slave in version 5.6 does not clean up replicated information stored in memory such as master host, master port, master user, or master password, which means that if you do not use the change master command to redirect, execute start slave or point to Old master.
When the reset slave is performed from the library, the MYSQLD shutdown replication parameters are reset.
Use RESET SLAVE all to completely clean up replication connection parameter information in the 5.6.3 version and later. (Bug #11809016)
RESET SLAVE All does not clear the Ignore_server_ids list set by Change MASTER to. This issue was fixed in MySQL 5.7. (Bug #18816897)
In MySQL 5.6.7 and later, RESET SLAVE causes a implicit commit of an ongoing transaction. 13.3.3, "statements that cause a implicit Commit".
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.