新版SQL授权用户时报错 near 'IDENTIFIED BY '密码' with grant option' 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)

 

 

转载:https://blog.csdn.net/hxpjava1/article/details/86688662

posted @ 2020-08-04 16:25  Black_Climber  阅读(1418)  评论(0编辑  收藏  举报