33
show grants for charm@'localhost';

---------------------+
| Grants for charm@localhost                                                                                   |
+-----------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'charm'@'localhost' IDENTIFIED BY PASSWORD '*EDD1CD76B1331E363B2BAED3F0B7EAF28559FBEWD' |
| GRANT ALL PRIVILEGES ON `charmstyle_com`.`charmstyle_com` TO 'charm'@'localhost' 

我用了

grant all on charmstyle_com to charm@'localhost' IDENTIFIED BY 't1q4gytrur';
flush privileges;

然后我导入数据库,它显示一个错误:

   ERROR 1142 (42000) at line 29: CREATE command denied to user 'charm'@'localhost' for table 'adminnotification_inbox'
4

1 回答 1

45

您仅授予用户对 'charmstyle_com' 数据库中的 'charmstyle_com' 表的权限。您可能想要的是授予“charmstyle_com”(或至少“adminnotification_inbox”表)中所有表的权限

 GRANT ALL PRIVILEGES ON `charmstyle_com`.* TO 'charm'@'localhost' 

或者

 GRANT ALL PRIVILEGES ON `charmstyle_com`.`adminnotification_inbox` 
     TO 'charm'@'localhost' 
于 2012-03-27T10:09:28.857 回答