Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 518
grandnasty Avatar asked Jul 07 '10 19:07

grandnasty


1 Answers

  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.
like image 148
desertwebdesigns Avatar answered Oct 10 '22 17:10

desertwebdesigns