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

I have set the Master DB Name as MDB and in the Slave server I set to replicate-do-db=SDB, but this did not work. But when I set it up as the same DB name it works. Is there any solution out there to setup one master db with two different slaves but in the same server?

share|improve this question

4 Answers 4

up vote 1 down vote accepted

Your question appears somewhat muddled, as you appear to be talking about two completely different things.

  1. Master and slave replicating a database with a different name - Won't work, as the database name is the identifier.
  2. Having a master and one or more slaves on the same machine - No problem, just run them on different ports.
share|improve this answer
    
Although I believe the poster wasn't asking this, you can rewrite the database name while replicating. i.e. Master:db1->Slave:db2. Use --replicate-rewrite-db for this. See: dev.mysql.com/doc/refman/5.0/en/… –  Martijn Heemels Dec 24 '09 at 12:34

MySQL replication is per-server not per database.

Database is just a catalogue of related tables; it should not be considered anything more. Replication always replicates the database name as well as the table name.

You can replicate from one server to another on the same host (running multiple mysql instances is no problem).

You cannot, and should not want to, replicate to a different catalogue within the same server.

share|improve this answer

Slaves must be identical to their masters. A slave database is intended to appear on a different server. If you wish for a slave to appear in the same server box as the master you may want to consider visualization. However, I doubt visualizing a slave db is an efficient idea. If visualization is looking attractive you may want to reconsider your server layout.

share|improve this answer

This direct from the documentation.

replicate-rewrite-db=slavedb->masterdb I know this works I just set it up and it's working

share|improve this answer

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.