Bug #6774 Replication fails with Wrong usage of DB GRANT and GLOBAL PRIVILEGES
Submitted: 23 Nov 2004 16:20 Modified: 1 Feb 2007 0:32
Reporter: Mikael Fridh Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:4.0.22 OS:Linux (Linux-ia64)
Assigned to: Alexey Kopytov CPU Architecture:Any

[23 Nov 2004 16:20] Mikael Fridh
Replication on the slaves fail when a syntactically incorrect GRANT statement returns Ok on the Master.

*************************** 1. row ***************************
          Master_User: repl
          Master_Port: 3306
        Connect_retry: 60
      Master_Log_File: ongame-bin.003
  Read_Master_Log_Pos: 240476331
       Relay_Log_File: ongame-relay-bin.002
        Relay_Log_Pos: 138988324
Relay_Master_Log_File: ongame-bin.003
     Slave_IO_Running: Yes
    Slave_SQL_Running: No
           Last_errno: 1221
           Last_error: Error 'Wrong usage of DB GRANT and GLOBAL PRIVILEGES' on query. Default database: ''. Query: 'GRANT PROCESS ON * TO cactiuser@'' IDENTIFIED BY 'mysqlrules''
         Skip_counter: 0
  Exec_master_log_pos: 138988242
      Relay_log_space: 240476413
1 row in set (0.00 sec) 

How to repeat:
Run this query on the master:
GRANT PROCESS ON * TO cactiuser@'' IDENTIFIED BY 'mysqlrules';

The query returns Ok, 0 rows affected on the master, and replicates to the slaves.
On the slaves the query fails and replication stops.

Suggested fix:
Make the syntactically erroneous query fail on the master.
[8 Aug 2005 21:46] James Doherty
I can confirm this bug - I ran a very similar query while setting up cacti to graph mysql stats and replication broke. Hope they fix this!
[19 Jun 2006 18:25] michael halligan
This bug exists in 5.0.19 as well. Same exact situation, trying to set it up so Cacti can monitor mysql.
[14 Sep 2006 20:17] Brian Viveiros
We had the exact same problem setting up Cacti as well.  

Not sure why it has been open for so long and is set to Non-critical as this causes replication to halt!!!  

As many others, we have reporting applications running against our replicated instance so if replication stops our reports become out of date.
[23 Jan 2007 12:05] Alexey Kopytov
This bug was fixed by the patch for bug #19022, bug #17199 and bug #18444. Not reproducible on 5.0.23 and up.
[24 Jan 2007 13:45] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:


ChangeSet@1.2391, 2007-01-24 16:45:30+03:00, kaa@polly.local +2 -0
  Added a test case for bug #6774 "Replication fails with Wrong usage of DB GRANT and GLOBAL PRIVILEGES"
[25 Jan 2007 12:57] Alexey Kopytov
Pushed to 5.0-maint and 5.1-maint.

Do a documentor: this bug was fixed as a part of Kostja's work on bug #19022, bug #17199 and bug #18444. The changeset for this bug only adds a test case for it.

4.0 and 4.1 still have this bug.
[1 Feb 2007 0:32] Jon Stephens
Thank you for your bug report. This issue has already been fixed in the latest released version of that product, which you can download at


Documented bugfix in 5.0.23 and 5.1.12 changelogs.