MySQL 8.0.x 用户授权报错 1064 (42000)

一、错误

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED BY '123456' WITH GRANT OPTION' at line 1


二、原因

MySQL 8.0新版本已经将创建用户用户赋权的方式分开了。


三、解决方法

  • 创建用户:create user ‘用户名’@’访问主机’ identified by ‘密码’;
  • 用户赋权:grant 权限列表 on 数据库 to ‘用户名’@’访问主机’ ;(修改权限时在后面加with grant option)
发布了212 篇原创文章 · 获赞 151 · 访问量 50万+

猜你喜欢

转载自blog.csdn.net/yhj19920417/article/details/83549446
今日推荐