[Solved] MYSQL8.0 Error: the user specified as a definer (‘root’@’%’) does not exist

Description (can be ignored, see the solution below directly)

When modifying database data, the user-specified as a definer (‘root ‘@’% ‘) does not exist error is encountered

Using the method of Online

grant all privileges on *.* to root@"%" identified by "Passwd"

Prompt syntax error

The reason is that mysql8.0 grant authorization is not followed by identified by

Re-enter

grant all privileges on *.* to 'root'@'%';

Error again

After querying the data, it is found that it is a version problem. After version 8.0.11, the grant statement is removed to add users, that is, Grant… Can only be applied to existing accounts, not through grant   To add an account.

resolvent

mysql> create user 'root'@'%' identified by 'password';
Query OK, 0 rows affected (2.35 sec)
 
mysql> grant all privileges on *.* to 'root'@'%';
Query OK, 0 rows affected (0.06 sec)
 
mysql> flush privileges;
Query OK, 0 rows affected (0.06 sec)

Local processing

create user 'root'@'%' identified by '1234';

grant all privileges on *.* to 'root'@'%';

flush privileges;

end!

Similar Posts: