码迷,mamicode.com
首页 > 数据库 > 详细

mysql performance_schema/information_schema授权问题

时间:2016-08-17 12:04:20      阅读:2077      评论:0      收藏:0      [点我收藏+]

标签:

mysql> grant all on performance_schema.* to ‘testuser‘@‘%‘;
ERROR 1044 (42000): Access denied for user ‘root‘@‘localhost‘ to database ‘performance_schema‘
mysql> grant all on information_schema.* to ‘testuser‘@‘%‘;
ERROR 1044 (42000): Access denied for user ‘root‘@‘localhost‘ to database ‘information_schema‘
mysql> grant select on information_schema.* to ‘testuser‘@‘%‘;
ERROR 1044 (42000): Access denied for user ‘root‘@‘localhost‘ to database ‘information_schema‘

mysql> grant select on performance_schema.* to ‘testuser‘@‘%‘;
Query OK, 0 rows affected (0.00 sec)

mysql> grant drop on performance_schema.* to ‘testuser‘@‘%‘;
Query OK, 0 rows affected (0.00 sec)

mysql> grant drop on information_schema.* to ‘testuser‘@‘%‘;
ERROR 1044 (42000): Access denied for user ‘root‘@‘localhost‘ to database ‘information_schema‘

总结:

information_schema所有用户默认就有权限,相当于oracle的user_*视图,目测不支持(也无需)显示授权,包括select。

performance_schema默认等同于普通db,唯一的区别在于不支持all权限,需要显示授予select/drop等权限(要truncate必须有drop权限)。

mysql performance_schema/information_schema授权问题

标签:

原文地址:http://www.cnblogs.com/zhjh256/p/5779062.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!