我有一个用户目前正在运行我的MySQL数据库。我想通过执行以下命令来查看该用户拥有的权限:
SHOW GRANTS FOR 'myuser'@'localhost';
我得到了
ERROR 1141 (42000): There is no such grant defined for user 'myuser' on host 'localhost'
因为该用户当前正在进行读写操作,所以我应该能看到某些权限,对吧?
编辑: 当我运行以下查询以查看与用户关联的主机名时,它返回%
作为主机。
select host from mysql.user where user = 'myuser';
localhost
。使用select host from mysql.user where user = 'myuser';
来查看他账户中的主机名。 - Barmar