开发者

MySQL replication best practices

开发者 https://www.devze.com 2023-01-06 13:27 出处:网络
I\'m setting up MySQL replication via binlog. It\'s a master / slave setup. I have a few questions on how to do this the best way.

I'm setting up MySQL replication via binlog. It's a master / slave setup.

I have a few questions on how to do this the best way.

  1. Should information_sch开发者_如何学Pythonema be replicated, if yes/no, why?
  2. Should mysql db be replicated, if yes/no, why?
  3. If it all should be replicated, no binlog-do-db needs to be set?

Cheers.


  1. No, Information Schema should NEVER be replicated. This is meta data about your tables, dbs, routines, triggers, etc. Let the server populate it's own information_schema.
  2. mysql db is fine to replicate, especially in the instance where you will be setting up a number of users. If your master fails, you will need the same user information available on your slave server in order to fail over to it. If that should occur, you need to have the same privileges available.
  3. List only the database you want replicated with binlog-do-db. If you don't list any, everything will be replicated by default.


  1. No. need to replicate information schema read this for detail https://dev.mysql.com/doc/refman/5.0/en/information-schema.html
  2. Yes you can because mysql database contains all user credentials so in order to have a backup of users you can replicate it.
  3. Yes use binlog-do-db to replicate selected databases otherwise everything will be replicated if nothing mentioned.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号