Question

Can we replicate slave with different database name?.

Posted June 19, 2018 659 views
CentOS MySQL

Currently, I’m doing with same DB name. I’m planning to have centralized DB replication for 3 servers. but the problem is the name of the database in all servers is same.

Can we replicate to slave with different name as shown below?

Master database to replicate : abc

Salve database: abc_1

edited by AHA

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

1 answer

You should technically have the database name be the same, because the database is replicated it is an exact copy so you want to make sure that the naming remains consistent. I’m not 100% sure if you can even replicate it with a different name, as I’ve never really seen that request before. Not sure what the reasoning for using a different name would be.

You instead use the hostnames of the different DB servers to designate which one is the master, and which ones are the replicas, as well as of course the configuration of the DB itself which specifies that.

But you want to confirm with standard practices to ensure that everything works smoothly, so I would recommend to not switch the database names.

Submit an Answer