指定为定义者的用户不存在

编程入门 行业动态 更新时间:2024-10-19 22:17:12
本文介绍了指定为定义者的用户不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在将数据库备份导入到现有网站后,出现以下错误:

('someuser'@'%')不存在

我已经登录我的数据库,执行

SHOW PRIVILEGES;

我可以看到我被允许

因此,我执行

CREATE USER'someuser'@'localhost'IDENTIFIED BY'password'

但我得到以下错误:

#1227 - 访问被拒绝;您需要(至少一个)此操作的CREATE USER权限

/ p>

GRANT ALL ON *。* TO'someuser'@'%'IDENTIFIED BY'password'; FLUSH特权;

,但得到以下响应:

#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.

更多推荐

指定为定义者的用户不存在

本文发布于:2023-11-15 22:36:14,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不存在   定义   用户

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!