mysql 8.0.11 中使用 grant ... identified by 时 error 1064 near 'identified by '密码''
grant ... identified by 时 error 1064 near 'identified by '密码''
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)
A geek and poetry lover.