学堂 学堂 学堂公众号手机端

Mysql:The user specified as a definer (‘root‘@‘%‘) does not exist 的解决办法

lewis 6年前 (2020-01-22) 阅读数 6 #技术

Mysql5+处理办法:

mysql -hlocalhost -uroot -p
grant all privileges on *.* to root@"%" identified by ".";
flush privileges;
Mysql8+处理办法:

mysql -hlocalhost -uroot -p
grant all privileges on *.* to 'root'@'%' with grant option;
flush privileges;
如果没有'root'@'%' 用户。mysql安装的时候默认的root是root@localhost


所以授权之前还得新建一个用户。

mysql >create user 'root'@'%' identified by 'root';



版权声明

本文仅代表作者观点,不代表博信信息网立场。

热门