1064 for the right syntax to use near ‘identified by ‘password’ with grant option’
1064原因分析 :此版的的mysql版本把将创建账户和赋予权限分开了。
- 创建账户::create user ‘用户名’@‘访问主机’ identified by ‘密码’;
- 赋予权限:grant 权限列表 on 数据库 to ‘用户名’@‘访问主机’ ;
- with grant option这个选项表示该用户可以将自己拥有的权限授权给别人
1410 - You are not allowed to create a user with GRANT
解决办法:于是修改host:update user set host=’%’ where user=‘wecube’;
- 创建账户
create USER 'wecube'@'%' identified by 'Abcd1234';
- 赋予权限,with grant option这个选项表示该用户可以将自己拥有的权限授权给别人
grant all privileges on wecube_dev.* to 'wecube'@'%' with grant option
flush privileges;