MySQL Forums
Forum List  »  Replication

Replication multiple database
Posted by: Sam Hasan
Date: April 02, 2009 10:43PM

Hi. I'm just learning MySQL and would like to ask help from you guys.

I have 2 servers running MySQL 5 and and already managed to do replication successfully based on the tutorial I found on the net. But the tutorial only show how to replicate one database. So for my question: how can I replicate multiple databases?

Do I need to specify in the Master my.cnf:

binlog-do-db=database1
binlog-do-db=database2
binlog-do-db=database3

and Slave:

replicate-do-db=database1
replicate-do-db=database2
replicate-do-db=database3

then repeat this command for each database?
mysql> change master to master_host='master-ip', master_user='repl', master_password='password',master_log_file='database1.000002', master_log_pos=230;

-----

one more question. let say I don't want to replicate database2 anymore, what should I do to remove it from being replicate? does removing the lines from Master and Slave my.cnf enough or there's a command I need to run on the MySQL console?

Million thanks in advance.

Options: ReplyQuote


Subject
Views
Written By
Posted
Replication multiple database
7574
April 02, 2009 10:43PM
2766
April 03, 2009 03:53AM
2835
April 04, 2009 10:27PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.