Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a mysql read-only replication slave setup and currently working for about 10 databases and I need to add 3 new databases. I cannot find any information on how to add additional information. Does anyone have some guidance on how to do this?

Thanks.

share|improve this question
add comment

2 Answers 2

I am assuming an operational replication configuration with your MySQL servers.

First, you create the database on the master. On the slaves, you update your cnf specifying replicate-do-db for the new databases. replicate-do-db is configured in either the cnf or as a flag (--replicate-do-db) and cannot be changed dynamically as a variable.td

From that point, you can populate the schema and master on the data and replicate down.

You can also create and populate the database on the master and all slaves then enable replicate-do-db. The key is making sure that the data matches before enabling replication on the slaves.

share|improve this answer
    
I so I added the databases to the cnf file on the slave for replicate-do-db like I have the other databases that are currently working. Then I did a create database on the master and added some data to it but it is not replicating.. –  Greg Arcara Jun 21 '10 at 19:02
    
You have to restart MySQL. Also, use statement must proceed queries. –  Warner Jun 21 '10 at 20:55
add comment

To add additional databases to sync:

  • stop slaves
  • add another binlog-do-db / replicate-do-db to server my.cnf
  • make a copy of the new databases to sync with rsync
  • stop master
  • freshen the copy of the new databases to sync with rsync
  • start master
  • copy the copies of the new databases to slave servers
  • start slaves
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.