MySQL master-Slave simple configuration

Source: Internet
Author: User

Connect to a source code installation mysql5.6.

    1. The master and slave servers are installed with msyql5.6

    2. Logbin logs are turned on both the primary and slave servers.

    3. The master and slave servers are Server-id, and the ServerID number is different.

    4. Primary server Configuration Sync account

      Grant Replication Slave on * * to ' repl ' @ ' 192.168.4.31 ' identified by ' repl ';

      Flush privileges;

      Show master status; View the primary server binary file information.

      You can start synchronization from the first line of the first binary log. You can also stop the primary server from writing, use mysqldump to import from the server, and synchronize from the binary location of the record.

    5. From the server configuration to which primary server, what account synchronization, synchronization content from the binary document start.

      Change MASTER to master_host= ' 192.168.4.50 ', master_user= ' repl ', master_password= ' repl ', master_log_file= ' Mysql-bin.000001 ', master_log_pos=0;

      start slave; boot from service. When the boot succeeds, it is logged in the data file from the server-related configuration.

      show slave status; View synchronization from service. After synchronization is complete, set prohibit write to slave server.

This article is from the "Elder Don" blog, please be sure to keep this source http://zhanglaotang.blog.51cto.com/3196967/1543005

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.