mysql官方解释:https://bugs.mysql.com/bug.php?id=55286
Description:
Hello,
there is a problem with GRANT and the replication. The slave uses "skip_name_resolv" and the binlog_format is 'MIXED' on the master.
If you grant something to an user with an IP there is no problem. It fails with characters in host.
Regards,
Holger
mysql> SHOW SLAVE STATUSG
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: gedoens.bonn.de
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: peter-bin.000003
Read_Master_Log_Pos: 369172211
Relay_Log_File: slave-relay.000004
Relay_Log_Pos: 331284199
Relay_Master_Log_File: peter-bin.000002
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 1133
Last_Error: Error 'Can't find any matching row in the user table' on query. Default database: ''. Query: 'GRANT SELECT ON `mysql`.* TO 'peter'@'bonn.de''
Skip_Counter: 0
Exec_Master_Log_Pos: 864830422
Relay_Log_Space: 909370294
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 1133
Last_SQL_Error: Error 'Can't find any matching row in the user table' on query. Default database: ''. Query: 'GRANT SELECT ON `mysql`.* TO 'peter'@'bonn.de''
1 row in set (0.00 sec)
How to repeat:
- use "skip_name_resolv" on the slave
- Create an user on the master with characters in the host.
- Grant something to this user