指定为定义者的用户不存在 [英] The user specified as a definer does not exist
问题描述
在将数据库备份导入到现有网站后,出现以下错误:
我已经登录我的数据库,执行
SHOW PRIVILEGES;
我可以看到我被允许
< >
因此,我执行
CREATE USER'someuser'@'localhost'IDENTIFIED BY'password'
但我得到以下错误:
< >
#1227 - 访问被拒绝;您需要(至少一个)此操作的CREATE USER权限
/ p>
GRANT ALL ON *。* TO'someuser'@'%'IDENTIFIED BY'password'; FLUSH特权;
,但得到以下响应:
< blockquote>
#1045 - 用户anotheruser拒绝访问@'%'(使用密码:YES)
请有人帮我解决这个问题!我已经阅读了另一个类似的帖子,但这些答案不适用于我,因为我得到了上述指定的响应。
导致创建脚本失败的定义器与存储过程/函数,事件和触发器相关。
解决问题的一种方法是在自己的用户中搜索并替换脚本中所有不存在的用户的实例。
I get the following error after importing my database's backup into an already existing website:
The user specified as a definer ('someuser'@'%') does not exist
I am already logged into my database, and when I execute
SHOW PRIVILEGES;
I can see that I am allowed
"To give to other users those privileges you posses..."
Consequently, I execute
CREATE USER 'someuser'@'localhost' IDENTIFIED BY 'password';
but I get the following error:
#1227 - Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation
I also tried the
GRANT ALL ON *.* TO 'someuser'@'%' IDENTIFIED BY 'password'; FLUSH PRIVILEGES;
alternative, but got the following response:
#1045 - Access denied for user 'anotheruser'@'%' (using password: YES)
Please someone help me out with this! I've read into another similar posts but those answers didn't work for me since I got the above specified responses.
The definer that cause the creation script to failed is related to stored procedures/functions, events and triggers.
One way to work around your problem would be to search and replace all the instances, in the script, of your non-existing user by your own user.
这篇关于指定为定义者的用户不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!