MySQL master-slave server synchronization experience page 1/2

Source: Internet
Author: User

I have seen the implementation of Mysql Data Synchronization, but I have not done it myself. Today I have nothing to do with it. There is another empty computer next to it, all under the same vro. Haha, exactly.

But first, I got stuck in the configuration file for a long time. Because I used the XAMPP installation package, I was never found in the XAMPP/MySQL/bin directory. CNF, which is not found in the C: Windows directory,

For example, we can see that there is only one "my" Speed dial-up item, and it cannot be opened even if it is not a file. Later, I found it on the internet for a long time. In this case, I need to open editplus first, and then open the file from editplus...

I will not go into details about the configuration. There are a lot of web pages, and I also turned around one article.

Today, we will focus on considerations for configuring the master-slave server:

First, the master database must be identical. If your database has been running for a period of time, we recommend that you delete all binary log files, including the index XXX. index file. Otherwise, an error occurs when you restart MySQL.

All binary log files have been deleted from the server, including a master.info file. This file is used to record the log files and recording locations on the master server. If you do not delete it, it will also follow the previous records, so there will be problems. I am wasting a lot of time here.

Master server diagnosis:

Show processlist; displays all processes.

Show Master Status; displays the log files and pointer locations of the master server.

Mysql> show Master status;
+ ------ + ---- + ------ +
File position binlog_do_db binlog_ignore_db
+ ------ + ---- + ------ +
Mysql-bin.000001 603 videocommunity
+ ------ + ---- + ------ +
1 row in SET (0.00 Sec)

Mysql> show Master Status \ G
* *************************** 1. row ***************************
File: mysql-bin.000001
Position: 603
Binlog_do_db: videocommunity
Binlog_ignore_db:
1 row in SET (0.00 Sec)

For example, the mysql-bin.000001 is a logging file, and 603 is a pointer position.

Diagnose on the server (slave:

Mysql> show slave status \ G
* *************************** 1. row ***************************
Slave_io_state: Waiting for Master to send event
Master_host: master1
Master_user: Root
Master_port: 3306
Connect_retry: 60
Master_log_file: mysql-bin.000001
Read_master_log_pos: 603
Relay_log_file: master2-relay-bin.000053
Relay_log_pos: 740
Relay_master_log_file: mysql-bin.000001
Slave_io_running: Yes
Slave_ SQL _running: Yes
Replicate_do_db: videocommunity
Replicate_ignore_db:
Replicate_do_table:
Replicate_ignore_table:
Replicate_wild_do_table:
Replicate_wild_ignore_table:
Last_errno: 0
Last_error:
Skip_counter: 0
Exec_master_log_pos: 603
Relay_log_space: 740
Until_condition: None
Until_log_file:
Until_log_pos: 0
Master_ssl_allowed: No
Master_ssl_ca_file:
Master_ssl_ca_path:
Master_ssl_cert:
Master_ssl_cipher:
Master_ssl_key:
Seconds_behind_master: 0
1 row in SET (0.00 Sec)

Check whether the above information is consistent with that of the master server.

Related Article

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.