MySQL8.0以上版本开启远程访问权限

  1. 登录
  2. 命令
    • create user 'root'@'%' identified by 'r'; # root为用户名,%需要访问的机器的IP,r是密码
    • grant all on . to 'root'@'%'; # root为用户名,%需要访问的机器的IP
    • alter user 'root'@'%' identified with mysql_native_password by 'r'; # root为用户名,%需要访问的机器的IP,r是密码
    • flush privileges; # 刷新权限,让设置生效
posted @ 2021-05-18 09:51  牛五  阅读(387)  评论(0编辑  收藏  举报