mysql开启远程访问权限

Mysql 8.0之前的版本:

 

grant all privileges on *.* to 'root'@'%' identified by '密码' with grant option;

 

Mysql 8.0以后的版本:

CREATE USER 'root'@'%' IDENTIFIED BY '密码';

GRANT ALL ON *.* TO 'root'@'%';

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '密码';

 

刷新权限:

FLUSH PRIVILEGES;

posted @ 2020-11-25 17:02  没有头发  阅读(151)  评论(0编辑  收藏  举报