I couldn't find an answer to my question.
I have 2 mysql servers.
Now i want to add another Slave server but i have other website running on that server.
Can i replicate just one database?
MySQL replication is a process that enables data from one MySQL database server (the master) to be copied automatically to one or more MySQL database servers (the slaves).
What Is Master-Slave Replication? The master-slave replication process enables database administrators to replicate or copy data stored in more than one server simultaneously. This helps the database administrator to create a live backup of the database all the time.
Yes you can
If you want to replicate just one database from master, you can set replicate-do-db
in your /etc/my.cnf
or set replicate-do-db
as mysql argument, for example:
replicate-do-db=db01
If you have multi databases to be replicated, /etc/my.cnf
should be like this:
replicate-do-db=db01
replicate-do-db=db02
If you just want slave to ignore some database, you can set replicate-ignore-db
:
replicate-ignore-db=db01
More details on MySQL document: http://dev.mysql.com/doc/refman/5.1/en/replication-options-slave.html#option_mysqld_replicate-do-db
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With