|
mysql4下(不熟悉mysql4),创建一个db,然后给hello用户访问hello db的权限
我创建时使用的是%,它表示任何机器都可以,但是在本机上访问却失败! 见详细的过程
mysql> create database hello;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on hello.* to 'hello'@'%' identified by 'hello';
Query OK, 0 rows affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)
mysql> exit
Bye
[root@qht2 ~]# /usr/local/mysql4027/bin/mysql -u hello -p'hello'
ERROR 1045: Access denied for user: 'hello@localhost' (Using password: YES) ##这里提示失败,但我添加用户时指定的是%
[root@qht2 ~]# /usr/local/mysql4027/bin/mysql -h 192.168.1.9 -u hello -p'hello' ##加上-h参数就可以了!
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 18 to server version: 4.0.27-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
以上的命令在mysql5.0.45下就不会有问题!但在mysql4.0.27下去出现上面问题!
麻烦兄弟帮忙解释下! |
|