这个错误到底是什么?
我使用的数据库是MySQL 5.1。我相信,我在 web.config 中指定了正确的连接字符串。但是当我运行我的网络应用程序时。它抛出这个异常:-
MySql.Data.MySqlClient.MySqlException:指定为定义者的用户('root'@'%')不存在
任何帮助。为什么我会得到这个?
Database i am using is MySQL 5.1. I specified, i believe, right connectionstring in my web.config. but when i run my web app. it throws this exception:-
MySql.Data.MySqlClient.MySqlException: The user specified as a definer ('root'@'%') does not exist
Any help. Why am i getting this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您已加载的存储过程的源代码可能包含“DEFINER=root@'%'”作为定义的一部分 - 看起来有点像这样:
这里的问题是您的系统上没有帐户'根'@'%'。这很容易证明。从 MySQL 命令行:
我预计这会返回一条错误消息:
修复方法是更改存储过程的源,或者创建丢失的帐户:
拥有如此高的帐户通常不是一个好主意可从任何地方访问高级帐户,但那是另一回事了。
The source code for the stored procedures that you have been loading probably contain "DEFINER=root@'%'" as part of the definition - looking a bit like this:
The problem here is that you do not have an account on your system for 'root'@'%'. This can be easily demonstrated. From the MySQL command line:
I expect that this will come back with an error message:
The fix is to alter the source of your stored procedures, or to create the missing account:
It is not generally a good idea to have such a high-powered account accessible from anywhere, but that is another story.
我知道这个答案来得很晚,但我找到了一个根本不涉及更改任何权利的解决方案。
进入存储过程并删除
DEFINER
子句。服务器应该写入一个与您登录时使用的用户信息相匹配的新定义器。为我工作...
I know this answer comes very late, but I found a solution that doesn't involve changing any rights at all.
Go into your Stored Procedures and delete the
DEFINER
clause. The server should write in a new DEFINER that matches the user information you're logged in with.Worked for me...
这是在存储过程中吗?那么也许这篇博文会有所帮助(强调我的)。
Is this in a stored procedure? Then maybe this blog post helps (emphasis mine).