MySQL8授权root用户远端登录

2019-07-29 数据库 1373

开启MySQL8远端登录

You are not allowed to create a user with GRANT
  • 创建用户

create user 'root'@'%' identified by '密码';
  • 设置权限

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
  • 刷新

FLUSH PRIVILEGES;
  • 可能出现的问题

# 因加密方式不同,本地连接可能会出现:
# Authentication plugin 'caching_sha2_password' cannot be loaded.
# 修改plugin = 'mysql_native_password'
alter user 'root'@'%' identified with mysql_native_password by '密码';
flush privileges;
0