mysql远程连接权限grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘123456‘ with grant optio语句报错

这条语句适用于MySQL8.0之前的

而MySQL8.0及之后的,设置远程连接权限要用下面的语句才可以

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

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

 

1、创建用户

CREATE USER '用户名'@'host' IDENTIFIED BY '密码';

2.授权(全部数据库权限)

grant all privileges on *.* to '用户名'@'%' ;

3.刷新权限

flush privileges;

posted @ 2021-05-23 22:59  黑。白。  阅读(7380)  评论(0编辑  收藏  举报