information_schema对象权限问题


出于对infomation_schema虚拟数据库对象权限的不熟悉

在应用提出需要访问innodb_locks数据权限时,想着通过以下方式赋权

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

原因是information_schema数据库的权限是默认对所有用户开放的

再具体访问数据库里面的表数据时,又有如下报错:

mysql> select * from innodb_locks;
ERROR 1227 (42000): Access denied; you need (at least one of) the PROCESS privilege(s) for this operation

该问题可以通过process权限解决

GRANT PROCESS ON *.* TO 'test'@'%'

搞定


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM