Posted on

A replication slave setup that isn’t set up…

So, you do

GRANT REPLICATION SLAVE ON *.* to 'repl'@'192.168.0.%' IDENTIFIED BY 'slavepwd';

and then

SHOW GRANTS FOR 'repl'@'192.168.0.%';

still shows only

GRANT USAGE ON *.* TO  'repl'@'192.168.0.%' IDENTIFIED BY ...

So the grant just disappeared… can have you going for while, eh?
The reason will be that you did an upgrade of the MySQL Server, without updating your privilege tables.
You always need to run the mysql_fix_privilege_tables script after doing an upgrade. Only the 4.1 Windows installer and the RPMs automatically do this for you. If you install from the binary tarball, or from source, you definitely need to run it yourself. It’s just part of the normal procedure.

I suppose MySQL could handle this better… I filed a bug report for it (#8308). Meanwhile, this may save you some headache.
This is one reason why MySQL developers hang out on public IRC channels like #mysql on irc.freenode.net… it’s educational.

Posted on