MySQL Forums
Forum List  »  Replication

Help understanding Master Slave replication behavior
Posted by: Pavin Joseph
Date: February 06, 2019 06:17PM

Hello MySQLers,

I'm new here and trying to understand the intricacies of MySQL Master Slave replication in version 5.5.

My current understanding/setup (please correct me where I'm wrong):

- GRANT statement updates the 'mysql' system database.
- In replication, master writes all transactions to binlog file, from which slave reads and copies to relay log file. The relay log file is then used to execute statements on slave.
- Setting binlog-do-db = mydb would tell master to only copy changes affecting mydb to binlog file.
- Not setting replicate-do-db or replicate-ignore-db on slave would execute all statements irrespective of DB from relay log file.

My problem with above setup:

Replication on slave failed with the following error
Last_Error: Error 'Table 'notmydb.sometable' doesn't exist' on query. Default database: ''. Query: 'GRANT SELECT,UPDATE on notmydb.sometable TO 'user'@'IPAddress' IDENTIFIED BY 'password''

My question:

- Why did master copy statements to be executed on 'mysql' database to binlog when I explicitly set it to copy only statements affecting mydb.

Thank you for consideration.

Kind regards,
Pavin Joseph.

Options: ReplyQuote

Written By
Help understanding Master Slave replication behavior
February 06, 2019 06:17PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.