标题: 权限已经设置过,为什么还是受限啊?? [打印本页] 作者: tracydundun 时间: 2008-8-22 16:11 标题: 权限已经设置过,为什么还是受限啊?? [root@www ~]# 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
[root@www ~]# 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
加入权限以后需要刷新一下:
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
不明白!
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'
还是不对!