mysql8版本执行 grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘root‘ with grant option; 会报错

mysql8版本执行 grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;
会报语法错误 ERROR 1064 (42000)

应先创建新用户
create user 'admin'@'%' identified by 'password';

执行授权

GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%';

刷新
flush privileges;

授权远程

ALTER USER 'admin'@'%' IDENTIFIED WITH mysql_native_password BY 'password';

刷新
flush privileges;

发布者:blog,转转请注明出处:https://www.04390.cn/lnmp/1195.html

(0)
blogblog
上一篇 2024年12月30日 上午9:57
下一篇 2025年6月5日 上午11:05

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注