MySQL master-slave replication test

Source: Internet
Author: User

MySQL master-slave replication test:

1. Configure the primary server:
Add a copy account to the main library
GRANT REPLICATION SLAVE on * * to ' mark ' @ '% ' identified by ' Mark ' with GRANT OPTION;

To add a configuration in the My.ini configuration file:
[Mysqld]
# Unique identifier of the service
Server-id=1
# Open binary log, default path under data/
Log-bin=mysql-bin
# binary file format
Binlog_format=row

View Status:
SHOW MASTER Status

2. Configure the Slave server:
server-id=2
Log-bin=mysql-bin
Binlog_format=row

To link a host on a Slave machine:
Change Master to master_host= "192.168.96.12", master_port=3306, master_user= "Mark", master_password= "Mark",
Master_log_file= "mysql-bin.000004", master_log_pos=107, master_connect_retry=10;
Start IO threads and SQL threads on the standby machine
Mysql>start slave;
View Status:
Show slave status


Then create a database db1 on master, build the table TB1, insert the data for testing

If an error occurs during the copy process, no subsequent replication is required, and slave can be set to skip the error:
#slave-skip-errors=1062,1053,1146 #跳过指定error No type error
#slave-skip-errors=all #跳过所有错误

MySQL master-slave replication test

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.