Description:
tables in schema mysql as below:
MySQL [mysql]> show tables;
+------------------------------------------------------+
| Tables_in_mysql |
+------------------------------------------------------+
| columns_priv |
| component |
| db |
| default_roles |
| engine_cost |
| func |
| general_log |
| global_grants |
| gtid_executed |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
| innodb_index_stats |
| innodb_table_stats |
| password_history |
| plugin |
| procs_priv |
| proxies_priv |
| replication_asynchronous_connection_failover |
| replication_asynchronous_connection_failover_managed |
| role_edges |
| server_cost |
| servers |
| slave_master_info |
| slave_relay_log_info |
| slave_worker_info |
| slow_log |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| user |
+------------------------------------------------------+
35 rows in set (0.00 sec)
The actual meaning represented by mysql.db table is Database-level privileges. However, mysql.db literally means all schema information. So mysql.db should be modified to mysql.db_priv, Refer to tables_priv and procs_priv
https://dev.mysql.com/doc/refman/8.0/en/grant-tables.html
These mysql database tables contain grant information:
user: User accounts, static global privileges, and other nonprivilege columns.
global_grants: Dynamic global privileges.
db: Database-level privileges.
tables_priv: Table-level privileges.
columns_priv: Column-level privileges.
procs_priv: Stored procedure and function privileges.
proxies_priv: Proxy-user privileges.
default_roles: Default user roles.
role_edges: Edges for role subgraphs.
password_history: Password change history.
How to repeat:
Not involved
Suggested fix:
The table name of mysql.db should be changed to db_priv