Critical MySQL 5.6 bug: any user with GRANT privileges can unwillingly cause all replicas to break
The latest major release of MySQL brought us a lot of new and exciting features. As always, new features come with brand new bugs waiting to bite you in the least expected way.
I was implementing a monitoring system for a client and needed to create a new dedicated user. I went ahead and granted the usual basic privileges but later, I discovered that this user also needed the REPLICATION CLIENT privilege because the monitoring needed it to check for replication status.
No big deal, let’s grant this as well. Unfortunately I did not get it right at first:
grant replication client on database.* to user@’10.%';
ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL
PRIVILEGES
Ouch! My bad! This is a global privilege and I should grant it on “*.*”:
grant replication client on *.* to …
[Read more]