如何在 Mysql 上显示用户名的授权?

如何在 Mysql 上显示用户名的授权?

更具体地说,我如何显示与用户名附加的复制授权?

答案1

尝试这个:

mysql> select Host, User, grant_priv, Repl_slave_priv, Repl_client_priv from mysql.user;

这应该会给你类似下面的输出:

+-----------+------------+------------+-----------------+------------------+
| Host      | User       | grant_priv | Repl_slave_priv | Repl_client_priv |
+-----------+------------+------------+-----------------+------------------+
| localhost | root       | Y          | Y               | Y                |
| localhost | dlo        | Y          | Y               | Y                |
+-----------+------------+------------+-----------------+------------------+
2 rows in set (0.00 sec)

答案2

对于基于架构的权限 SELECT * FROM information_schema.schema_privileges

相关内容