[Bug] Invalid of GRANT command will breaks replication
MySQL 5.6 has a bug to watch for: running GRANT privileges in PhpMyAdmin may cause a slave to stop replicating (bug report: http://bugs.mysql.com/bug.php?id=68892).
While using MySQL 5.6 (version 5.6.14-1) with replication, I encountered a problem after granting a user privileges in PhpMyAdmin. The slave stopped replicating and produced this error log:
Last_SQL_Errno: 1590
Last_SQL_Error: The incident LOST_EVENTS occured on the master. Message: error writing to the binary log
After seeing that error, I checked the master’s binary log and found LOST_EVENTS there. The problem appeared to be in writing the master’s binary log.
#131030 15:59:50 server id 100 end_log_pos 1777150 CRC32 0x2aa22c31
# Incident: LOST_EVENTS
RELOAD DATABASE; # Shall generate syntax error
This suggested a MySQL bug. I checked and found bug #68892 Invalid use of GRANT command breaks replication, described as follows:
Fixed in 5.6+. Documented fix in the 5.6.15 and 5.7.3 changelogs, as follows: Issuing a GRANT statement with invalid parameters caused the master to write LOST_EVENTS events into its binary logs, causing replication to stop. Now such cases, if one or more grants or revocations of privileges are successful, an incident is written to the log; otherwise, only a warning is logged.
Be careful when granting users privileges to avoid this problem.