MySQL configuration master-slave copy second article

Source: Internet
Author: User

After the query data, finally the MySQL master-slave copy is done. This version is mysql5.0. Okay, start talking about the steps.

First, the previous article has already said that it is necessary to copy an installation file to another disk. Next, modify the registry. OK, after that, we'll modify the My.ini file in the MySQL root directory.

Of course, you need to back up before you change. The province will not start up later.

-----------------------------------------

First modify the My.ini of the primary database you want to configure

-----------------------------------------

[Mysqld]
Server-id = 1
Log-bin = Mysql-bin
BINLOG-DO-DB = Test
binlog-ignore-db = MySQL
Port = 3306


[Client]
Port = 3306

-----------------------------------------

Next, modify the My.ini you want to configure from the database

-----------------------------------------

[Mysqld]

Port = 3307
Server-id = 2
Master-host = localhost
Master-port = 3306
Master-user = Rep1
Master-password = MySQL
REPLICATE-DO-DB = Test

Basedir= "D:/mysql/mysql Server 5.0/"

Datadir= "D:/mysql/mysql Server 5.0/data/"
[Client]
Port = 3307

I believe you have seen, the port number must not be configured to the same. All right. Once you're done, create a user in the main database, using the command line in this way

mysql> Change master to master_host= ' localhost ', master_user= ' rep1 ', master_password= ' MySQL ';

mysql> start slave;

The slave sync feature is activated.

Master-Slave synchronization check

Execute the following statement

1 mysql>show slave Status\g

Information for reference

Http://jingyan.baidu.com/article/0eb457e57356e803f1a90512.html

Http://www.cnblogs.com/rootq/articles/1065042.html

http://blog.csdn.net/zhangking/article/details/5662545

Http://blog.sina.com.cn/s/blog_4de07d5e0100wq19.html

Http://www.2cto.com/database/201403/288629.html

http://blog.csdn.net/junjieguo/article/details/7823594

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.