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';
参考文档:
The user specified as a definer ('root'@'%') does not exist_Litrainy的博客-优快云博客
mysql出现The user specified as a definer ('root'@'%') does not exist报错!_StaceyWeiStaceyWei的博客-优快云博客
本文介绍了在MySQL5+和8+版本中,如何进行权限授予以及解决'root'@'%'用户不存在的问题。在MySQL5+中,使用`grant all privileges on *.* to root@'%' identified by 'root'; flush privileges;`即可。而在MySQL8+,命令变为`grant all privileges on *.* to 'root'@'%' with grant option; flush privileges;`。如果缺少'root'@'%'用户,需要先创建:`create user 'root'@'%' identified by 'root';`。参考文档提供了详细的错误解决方案。
5052

被折叠的 条评论
为什么被折叠?



