Sometimes, you will see MySQL setups where only one database is being replicated. How to add a second database, so that it’s also replicated?
In my.cnf on both servers, add a second database:
![](https://lxadm.com/content/images/2022/09/Ekran-Resmi-2022-09-21-18.13.54.png)
Connect to mysql on both servers and add a new database:
![](https://lxadm.com/content/images/2022/09/Ekran-Resmi-2022-09-21-18.13.57.png)
Now, restart mysql on both servers and verify that replication works (be careful when restarting if there are any writes to the database; i.e. shutdown the secondary master first, then the primary master – depending on your environment):
![](https://lxadm.com/content/images/2022/09/Ekran-Resmi-2022-09-21-18.14.02.png)
After creating/dropping the example table on one server, verify it’s happening on the second server as well:
![](https://lxadm.com/content/images/2022/09/Ekran-Resmi-2022-09-21-18.14.06.png)
Don’t forget to add a user with proper privileges, i.e.:
![](https://lxadm.com/content/images/2022/09/Ekran-Resmi-2022-09-21-18.14.11.png)