mysql5.7在创建账户并授予权限遇到错误ERROR 1064 (42000)

错误的命令如下:

grant SELECT,UPDATE,INSERT,DELETE on . to 'work'@'%' identified by 'xxxx';

更改成两个语句:

create user 'work'@'%' identified by 'xxxx';

下面的语句依然报错:

grant SELECT,UPDATE,INSERT,DELETE on . to 'work'@'%';

grant SELECT,UPDATE,INSERT,DELETE on . to work@'%';

正确的为:

grant SELECT,UPDATE,INSERT,DELETE on *.* to 'work'@'%';

你可能感兴趣的:(mysql5.7在创建账户并授予权限遇到错误ERROR 1064 (42000))