tracydundun 发表于 2008-8-22 16:11:14

权限已经设置过,为什么还是受限啊??

# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.0.37 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> grant create ,drop         //在这里已经设置了CREATE的权限了!!
    -> on *.*
    -> to mysql;
Query OK, 0 rows affected (0.09 sec)

mysql> quit
Bye
# mysql -u mysql
Welcome to the MySQL monitor.Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.0.37 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create database book;                                                                         //这里还是不对啊?
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'book'
哪里的问题阿??

kider 发表于 2008-8-22 16:27:42

加入权限以后需要刷新一下:
mysql>flush privileges;

还可以检查一下你加入权限的结果,看看数据中是否有了记录:
mysql> select host,user,password from mysql.user;
+----------------------+----------+------------------+
| host               | user   | password         |
+----------------------+----------+------------------+
| localhost            | root   | 67457e226a1a15bd |
| deplinux.localdomain | root   | 67457e226a1a15bd |
| %                  | root   | 67457e226a1a15bd |
| %                  | mysql    | 68d4f47c49a579c9 |
+----------------------+----------+------------------+
8 rows in set (0.00 sec)

tracydundun 发表于 2008-8-22 16:48:56

不明白!
host   user      passwd      哪有权限啊?

mysql> show grants for mysql;
+--------------------------------------------------------------------------------------+
| Grants for mysql@%                                                                   |
+--------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'mysql'@'%' IDENTIFIED BY PASSWORD '565491d704013245' |
+--------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> create database test1;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'test1'
还是不对!

[ 本帖最后由 tracydundun 于 2008-8-22 16:57 编辑 ]

tracydundun 发表于 2008-8-22 17:32:50

以解决!谢谢

kider 发表于 2008-8-22 17:38:41

继续努力:victory:
页: [1]
查看完整版本: 权限已经设置过,为什么还是受限啊??