grant all命令有什么问题?

run*_*run 2 mysql

grant all privileges on 'bbs' to 'userone'@'localhost'  IDENTIFIED BY PASSWORD 'user2012';
Run Code Online (Sandbox Code Playgroud)

表明 ERROR 1064 (42000): You have an error in your SQL syntax; check the manual

我想添加用户userone并授予数据库所有权限bbs.怎么纠正呢?

Jes*_*run 8

您需要在要授予权限的数据库中包含表的指示符.更改查询:

grant all privileges on bbs.* to 'userone'@'localhost' IDENTIFIED BY PASSWORD 'user2012';

为"bbs"数据库中的所有表授予它.