The user specified as a definer does not exist

Viewed 28733

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.

2 Answers

As @Jonathan said, definer is usually related to functions/triggers definitions.

Now regarding your first error, you need to define 'someuser'@'%' before the import. This is different than 'someuser'@'localhost'.

regarding #1227 - Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation, it means your mysql user does not have this privilege.

You need to login with root, or give current user CREATE USER privilege(s).

Related