Bug #102457 The user's privileges are inconstant between master and slave
Submitted: 3 Feb 2021 2:50 Modified: 4 Feb 2021 12:46
Reporter: GONGTUI FU Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:8.0.18 OS:Red Hat (7.4)
Assigned to: CPU Architecture:x86

[3 Feb 2021 2:50] GONGTUI FU
Description:
I create an account and grant some privileges to it in Master server. However in Slave server, the privileges lost.

How to repeat:
Master:
mysql> create user 'dbproxy108';
Query OK, 0 rows affected (0.00 sec)

mysql> grant SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,GRANT OPTION on *.* to 'dbproxy108'@'%';
Query OK, 0 rows affected (0.00 sec)

mysql> show grants for 'dbproxy108';
+-------------------------------------------------------------------------------------------------+
| Grants for dbproxy108@%                                                                         |
+-------------------------------------------------------------------------------------------------+
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON *.* TO `dbproxy108`@`%` WITH GRANT OPTION |
+-------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

Slave:
mysql> show grants for 'dbproxy108';
+----------------------------------------------------------+
| Grants for dbproxy108@%                                  |
+----------------------------------------------------------+
| GRANT USAGE ON *.* TO `dbproxy108`@`%` WITH GRANT OPTION |
+----------------------------------------------------------+
1 row in set (0.00 sec)

Suggested fix:
It influences master-slave switching when using the account 'dbproxy108'.
I suggest reporting an error when using 'GRANT OPTION' after 'GRANT' and before 'TO', only support 'WITH GRANT OPTION' clause.
[4 Feb 2021 12:46] MySQL Verification Team
Hello GONGTUI,

Thank you for the report and feedback.
Imho this issue is no longer reproducible on latest GA build 8.0.23(fixed after Bug #100793). Could you please try on 8.0.23? Thank you!

regards,
Umesh