我创建了用户 'wordpress' 并通过 phpMyAdmin 在 mysql 上授予权限。但是,当我以用户 wordpress 在命令行登录时,我似乎无法访问我应该能够访问的内容。看一看:
>mysql -u wordpress
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.27 MySQL Community Server (GPL)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> SHOW GRANTS;
+--------------------------------------+
| Grants for @localhost |
+--------------------------------------+
| GRANT USAGE ON *.* TO ''@'localhost' |
+--------------------------------------+
1 row in set (0.00 sec)
这不应该显示Grants for wordpress@localhost
吗?
此外,我授予了所有(危险的,我知道,但我在进行健全性测试)在 datbase sitedb 上的 wordpress 特权。当我尝试使用 sitedb 时,我得到以下信息(这个,在同一个会话中):
mysql> USE sitedb;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'sitedb'
这是怎么回事?