MySQL:select command denied to user for table 'proc'案例

栏目: 数据库 · 发布时间: 6年前

内容简介:很是纳闷,后面使用同样的权限,发现使用命令工具mysql -h xxxx -u username -p连接时不会报错。个人猜测是因为EMS MySQL Manager(3.4.0.1)连接数据库时,会去查询mysql.proc表获取相关的对象(存储过程、函数等)。于是在测试服务器开启了MySQL查询日志,然后在客户端电脑使用EMS MySQL Manager Pro连接到数据库(Connect to Database),然后检查查询日志具体信息,发现如下所示,EMS MySQL Manager连接数据库时确

使用EMS MySQL Manager Pro(3.4.0.1)连接 MySQL 5.6.20时,报错: SELECT command denied to user xxx@xxx.xxx.xxx.xxx for table 'proc'

MySQL:select command denied to user for table 'proc'案例

很是纳闷,后面使用同样的权限,发现使用命令工具mysql -h xxxx -u username -p连接时不会报错。个人猜测是因为EMS MySQL Manager(3.4.0.1)连接数据库时,会去查询mysql.proc表获取相关的对象(存储过程、函数等)。于是在测试服务器开启了MySQL查询日志,然后在客户端电脑使用EMS MySQL Manager Pro连接到数据库(Connect to Database),然后检查查询日志具体信息,发现如下所示,EMS MySQL Manager连接数据库时确实会去查询mysql.proc, 而因为权限问题,所以报如上错误:

#tail -60f /var/lib/mysql/mytestlnx02.log 
/usr/sbin/mysqld, Version: 5.6.41 (MySQL Community Server (GPL)). started with:
Tcp port: 3306  Unix socket: /var/lib/mysql/mysql.sock
Time                 Id Command    Argument
190108 14:54:07   111 Connect   mytest@letnb00021 on 
                  111 Query     SHOW VARIABLES
                  111 Query     SHOW STATUS
                  111 Quit
                  112 Connect   mytest@letnb00021 on MyDB
                  112 Query     BEGIN
                  112 Query     show collation
                  112 Query     SHOW VARIABLES
                  112 Query     SHOW ENGINES
                  112 Query     SHOW FULL TABLES
                  112 Query     SHOW FULL TABLES
                  112 Query     SHOW COLUMNS FROM `mysql`.`proc`
                  112 Query     SHOW INDEX FROM `mysql`.`proc`
                  112 Query     select p.`db`, p.`name`, p.`type`, p.`specific_name`, p.`language`, p.`sql_data_access`, p.`is_deterministic`, p.`security_type`, p.`param_list`, p.`returns`, p.`body`, p.`definer`, p.`created`, p.`modified`, p.`sql_mode`, p.`comment` from `mysql`.`proc` as p where p.`type` = 'PROCEDURE' and p.`db`='MyDB'

解决方案:

  1:使用root账号登录数据库,执行下面 SQL 语句授予相关查询权限,即可解决问题(使用具体账号替换usename)

grant select on mysql.proc to username

  2: 在EMS MySQL Manager工具对应的Register Database的"Display Options" 选项里面,取消"Procedures"、"Functins"、"UDFS"选项也可以解决问题。这样EMS MySQL Manager连接数据库时,不会去查询相关的存储过程、函数等对象。就不会报这个错误。但是呢,这样就会在 工具 里面看不到这些对象。

MySQL:select command denied to user for table 'proc'案例


以上所述就是小编给大家介绍的《MySQL:select command denied to user for table 'proc'案例》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Getting Started with C++ Audio Programming for Game Development

Getting Started with C++ Audio Programming for Game Development

David Gouveia

Written specifically to help C++ developers add audio to their games from scratch, this book gives a clear introduction to the concepts and practical application of audio programming using the FMOD li......一起来看看 《Getting Started with C++ Audio Programming for Game Development》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

MD5 加密
MD5 加密

MD5 加密工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具