MySQL Forums :: Replication :: Replication multiple database


Advanced Search

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 6013 Sam Hasan 04/02/2009 10:43PM
Re: Replication multiple database 2500 Sam Hasan 04/03/2009 03:53AM
Re: Replication multiple database 2477 Rick James 04/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.