How to set the location of slave to read binlog in MySQL
This article is mainly about how to set slave to read the location of binlog in MySQL. If you are interested, let's take a look at this article. I believe it is of some reference value to you after reading how to set the location of slave to read binlog in MySQL.
Change_master- > global_init_info- > Master_info::mi_init_info- > Rpl_info_handler::init_info- > Rpl_info_file::do_init_info-> mi- > rli- > rli_init_info ()-> initialize. / relay-bin.000001,4 if relay-log.info does not exist Otherwise read / / initialize master_info structure int Master_info::mi_init_info () {if (inited) DBUG_RETURN (0) / / if the master_info file has been created, exit handler- > init_info () directly; / / create / open the master_info file if (check_return = = REPOSITORY_DOES_NOT_EXIST) {/ / if the master_info file has just been created, set the log location to be read as 4 init_master_log_pos (); |-- master_log_name [0] = 0 | |-- master_log_pos= BIN_LOG_HEADER_SIZE; |-- ssl_verify_server_cert= 0; |-- heartbeat_period= min (SLAVE_MAX_HEARTBEAT_PERIOD, (slave_net_timeout/2.0));} else {read_info (handler); / / read file} inited= 1; flush_info (TRUE) | | |-- handler- > set_sync_period (sync_masterinfo_period); / / default 10000 |-- flush_io_cache (& info_file);-- my_sync (info_fd, MYF (MY_WME)); DBUG_RETURN (0) | Int Rpl_info_file::do_init_info () {if (ret_check = = REPOSITORY_DOES_NOT_EXIST) {info_fd = my_open (info_fname, O_CREAT | O_RDWR | O_BINARY, MYF (MY_WME)); init_io_cache (& info_file, info_fd, IO_SIZE*2, READ_CACHE, 0L MYF (MY_WME)) } else if (ret_check = = REPOSITORY_EXISTS) {info_fd = my_open (info_fname, O_RDWR | O_BINARY, MYF (MY_WME)); init_io_cache (& info_file, info_fd, IO_SIZE*2, READ_CACHE, 0L Magne0, MYF (MY_WME))}}
If master.info does not exist, create and initialize the corresponding IO_CACHE
If it exists, open it and initialize the corresponding IO_CACHE
The above details about how to set up slave in MySQL to read the location of binlog are helpful to you. If you want to know more about it, you can continue to follow our industry information section.