简体   繁体   中英

MySQL replication best practices

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_schema 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM