Mysql远程授权报语法错误

MySQL8.0及之后的版本已经将创建账户和赋予权限的方式分开了,设置远程连接权限要用下面的语句才可以:

  • 创建账户
    create user root@'%' identified by '密码';
  • 赋予权限
    grant all privileges on *.* to root@'%' with grant option;
  • 刷新
    flush privileges
posted @ 2021-05-16 10:32  小帆敲代码  阅读(147)  评论(0编辑  收藏  举报