Description:
when I grant privileges use both "grant *.*" and "grant db.*",
"show grants for" only show the db.* privileges;
How to repeat:
GRANT SELECT ON `abc`.* TO 'account'@'%';
root@localhost : mysql 11:00:46> show grants for account;
+--------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for account@% |
+--------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT SELECT, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'account'@'%' IDENTIFIED BY PASSWORD '*xxx' |
| GRANT SELECT ON `abc`.* TO 'account'@'%' |
+--------------------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
root@localhost : (none) 10:48:42> grant select on *.* to account@'%';
Query OK, 0 rows affected (0.00 sec)
root@localhost : (none) 10:48:56> flush privileges;
Query OK, 0 rows affected (0.00 sec)
root@localhost : (none) 10:48:58> show grants for account;
+--------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for account@% |
+--------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT SELECT, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'account'@'%' IDENTIFIED BY PASSWORD '*xxx' |
| GRANT SELECT ON `abc`.* TO 'account'@'%' |
+--------------------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
root@localhost : mysql 11:00:32> select * from user where user='account'\G
*************************** 1. row ***************************
Host: %
User: account
Password: *xxx
Select_priv: Y
Insert_priv: N
Update_priv: N
Delete_priv: N
Create_priv: N
Drop_priv: N
Reload_priv: N
Shutdown_priv: N
Process_priv: N
File_priv: N
Grant_priv: N
References_priv: N
Index_priv: N
Alter_priv: N
Show_db_priv: N
Super_priv: N
Create_tmp_table_priv: N
Lock_tables_priv: N
Execute_priv: N
Repl_slave_priv: Y
Repl_client_priv: Y
Create_view_priv: N
Show_view_priv: N
Create_routine_priv: N
Alter_routine_priv: N
Create_user_priv: N
Event_priv: N
Trigger_priv: N
ssl_type:
ssl_cipher:
x509_issuer:
x509_subject:
max_questions: 0
max_updates: 0
max_connections: 0
max_user_connections: 0
1 row in set (0.00 sec)
Description: when I grant privileges use both "grant *.*" and "grant db.*", "show grants for" only show the db.* privileges; How to repeat: GRANT SELECT ON `abc`.* TO 'account'@'%'; root@localhost : mysql 11:00:46> show grants for account; +--------------------------------------------------------------------------------------------------------------------------------------------------+ | Grants for account@% | +--------------------------------------------------------------------------------------------------------------------------------------------------+ | GRANT SELECT, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'account'@'%' IDENTIFIED BY PASSWORD '*xxx' | | GRANT SELECT ON `abc`.* TO 'account'@'%' | +--------------------------------------------------------------------------------------------------------------------------------------------------+ 2 rows in set (0.00 sec) root@localhost : (none) 10:48:42> grant select on *.* to account@'%'; Query OK, 0 rows affected (0.00 sec) root@localhost : (none) 10:48:56> flush privileges; Query OK, 0 rows affected (0.00 sec) root@localhost : (none) 10:48:58> show grants for account; +--------------------------------------------------------------------------------------------------------------------------------------------------+ | Grants for account@% | +--------------------------------------------------------------------------------------------------------------------------------------------------+ | GRANT SELECT, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'account'@'%' IDENTIFIED BY PASSWORD '*xxx' | | GRANT SELECT ON `abc`.* TO 'account'@'%' | +--------------------------------------------------------------------------------------------------------------------------------------------------+ 2 rows in set (0.00 sec) root@localhost : mysql 11:00:32> select * from user where user='account'\G *************************** 1. row *************************** Host: % User: account Password: *xxx Select_priv: Y Insert_priv: N Update_priv: N Delete_priv: N Create_priv: N Drop_priv: N Reload_priv: N Shutdown_priv: N Process_priv: N File_priv: N Grant_priv: N References_priv: N Index_priv: N Alter_priv: N Show_db_priv: N Super_priv: N Create_tmp_table_priv: N Lock_tables_priv: N Execute_priv: N Repl_slave_priv: Y Repl_client_priv: Y Create_view_priv: N Show_view_priv: N Create_routine_priv: N Alter_routine_priv: N Create_user_priv: N Event_priv: N Trigger_priv: N ssl_type: ssl_cipher: x509_issuer: x509_subject: max_questions: 0 max_updates: 0 max_connections: 0 max_user_connections: 0 1 row in set (0.00 sec)