Should I exclude mysql database from multi master replication?

Posted on

Question :

Running mysql in a two master replication setup. There are many databases and they are all replicating correctly including the mysql database itself.

Is it safe to replicate mysql or should I exclude it via the my.cnf ?

Answer :

Since the mysql schema is usually manipulated with GRANT and REVOKE commands, there is no need to let the mysql schema replicate. Why ?

Someone could hack privileges in by means of INSERT commands into mysql.user.

Such hacks are possible because I wrote about it before

If these hacks were done on a Master, a Slave might intercept them. The new grants on the Slave would not be active until someone restarted mysqld on the Slave or ran FLUSH PRIVILEGES; on the Slave.

So, to answer your question: exclude it via the my.cnf

Leave a Reply

Your email address will not be published. Required fields are marked *