Some problems with MySQL master-slave replication configuration

Source: Internet
Author: User

Many online configuration tutorials, I also refer to other people's tutorial completed, mainly encountered the following several issues, if someone later met the same hope to write a hint to you.

1.MY.CNF file Configuration

The server_id configured in my.cnf on Master must be different from the server_id configuration in my.cnf on Slove

2.Master Create a data synchronization user and grant the appropriate permissions

mysql> Grant Replication Replication  on *. *  to ' Root '@'192.168.181.13'by'* * * * * * 

Where ' root ' is the user name (assigned by master) required for slave to get the data on master, ' 192.168.181.23 ' is the IP of slave, ' * * * * * * This is the password required for slave to get the master data.

3.Slave Synchronous Writing code

Mysql>Change Master toMaster_host='192.168.181.23', Master_user='Root', Master_password='*****', Master_port=3306, Master_log_file='edu-mysql-bin.000001', Master_log_pos=2194 , Master_connect_retry= -;

Master_user is allocated in the 2 Mster, here I want to talk about is Master_log_pos, this value is the master state in the corresponding position. The master_log_file corresponds to the file

MySQL> show Master Status;

If not, the Slave_io_running:no will not change in Slave even if start Slave but Slave state.

Some problems with MySQL master-slave replication configuration

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.