mysql 8.0.11 中使用 grant ... identified by 时 error 1064 near 'identified by '密码'' at line 1

1 问题:

当使用 grant 权限列表 on 数据库 to '用户名'@'访问主机' identified by '密码'; 时会出现"......near 'identified by '密码'' at line 1"这个错误

2 原因:

因为新版的的mysql版本已经将创建账户和赋予权限的方式分开了

3解决办法:

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

赋予权限:grant 权限列表 on 数据库 to '用户名'@'访问主机' ;(修改权限时在后面加with grant option)
————————————————
版权声明:本文为CSDN博主「Allan-li」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/li_0891/article/details/80915780

posted @ 2019-09-25 14:25  一半人生  阅读(668)  评论(0编辑  收藏  举报