MySQL 8.0:check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'password'' at line 1

【参考文章】:mysql 8.0.11 中使用 grant ... identified by 时 error 1064 near 'identified by '密码'' at line 1

1. 问题原因

  MySQL 8.0 版本之后语法有更新,创建用户语句和权限修改语句需要分开执行

2. 解决方法

  创建账户:create user '用户名'@'访问主机' identified by '密码';

  权限修改:grant 权限列表 on 数据库 to '用户名'@'访问主机' ;(修改权限时在后面加with grant option)

猜你喜欢

转载自www.cnblogs.com/virgosnail/p/12553668.html