MySQL 中的访问被拒绝,即使 GRANTS 看起来正确
我正在尝试在 MySQL 中创建一个存储过程。
当我尝试运行它时,出现错误:
Access denied for user: '<myuser>' to database '<mydb>'
但是,当我查看该用户的 GRANTS 时,我得到:
GRANT USAGE ON *.* TO '<myuser>'@'%' IDENTIFIED BY PASSWORD '<blah>'
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON `<mydb>`.* TO '<myuser>'@'%'
我可以创建/删除/更改表,没有问题,只是对存储过程没有任何乐趣。
(数据库由我的 ISP/Web 主机托管)
I'm trying to create a stored proc in MySQL.
When I try and run it, I get the error:
Access denied for user: '<myuser>' to database '<mydb>'
However when I look at the GRANTS for this user I get:
GRANT USAGE ON *.* TO '<myuser>'@'%' IDENTIFIED BY PASSWORD '<blah>'
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON `<mydb>`.* TO '<myuser>'@'%'
I can create / drop / alter tables no problem, just no joy with the stored proc.
(The database is hosted by my ISP / Web Host)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要创建存储过程,您需要
CREATE ROUTINE
权限。要执行它们,您需要EXECUTE
权限。看看这个: http://dev.mysql.com /doc/refman/5.0/en/stored-routines-privileges.html
To create stored procedures you need
CREATE ROUTINE
privilege. To execute them you needEXECUTE
privilege.Check this out: http://dev.mysql.com/doc/refman/5.0/en/stored-routines-privileges.html