Mysql – thesql best practices with replication of the thesql db (grants storage)

MySQLmysql-replicationmysql5

is there a best practice to ensure that privileges do not get replicated to mysql slave servers? the problem is, there a maintenance users in the mysql table that have different passwords on each box. things like startup/shutdown scripts use these tables. when you replicate from a master, it changes the password and breaks things.

what are best practices to ensure that the actual mysql db (that contains grants, users, hosts) does not break because of replication?

do you typically replicate privileges over to the slaves as well?

Best Answer

Don't use replicate-do-db and replicate-ignore-db, because those options are dangerous. look at this article.

Just use --replicate-wild-ignore-table=mysql.% option.

I would reccomend you to set --replicate-wild-ignore-table=mysql.user - this skip only password and global grants replication, while table and column level grants are still replicated.

You can also use SET SQL_LOG_BIN=0 to disable logging statements for current session, eg. when you create new user or change a password.

Related Topic