mysql-Master-slave Replication (ii)

Source: Internet
Author: User

1) Turn on the Binlog server on the primary server

Log-bin=mysql-bin

2) User authorization (not privileges authorization!!!!) ), properly licensed from the server as follows

Grant Replication Slave on * * to ' abc ' @ ' 192.168.1.104 ' identified by ' 123456 '

3) sync from server settings

mysql5.1.7 before configuring synchronization is to write the configuration information of the primary server on the MY.CNF profile

#主服务器的ipmaster-host=192.168.1.101# the user name and password master-user=abcmaster-password=123456# port that was just authorized by the primary server master-port=3306

mysql5.1.7, after the cancellation of this configuration, directly logged in MySQL, the command set parameters can be, the command is as follows

#登录mysql后执行 # This is to be performed on the server from the change master to master_host= ' 192.168.1.101 ', master_user= ' abc ', master_password= ' 123456 ';

  

Other Related commands:

1. Viewing from server information

Show Slave Status\g

If, slave_io_running and slave_sql_running all show yes, it means that the master-slave replication is configured;

If not yes, look at Last_io_error and Last_sql_error, these two will show the error prompt, and then self-Baidu or Google will be able to

2. Stop slave

Stop slave

3. Open slave

Start slave

4. Repeat slave

Reset Slave

mysql-Master-slave Replication (ii)

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.