日期:2014-05-16  浏览次数:20777 次

关于LINUX MYSQL的入门级问题
1. 用root用户在rhel6上安装了mysql5.5.21
2. 查看user;
mysql> select host,user,password from user;
+------------+--------+-------------------------------------------+
| host | user | password |
+------------+--------+-------------------------------------------+
| localhost | root | *6EDDDC1252719141ECAFB91142B8ECCC8C98A77B |
| rhel601 | root | *6EDDDC1252719141ECAFB91142B8ECCC8C98A77B |
| 127.0.0.1 | root | *6EDDDC1252719141ECAFB91142B8ECCC8C98A77B |
| ::1 | root | *6EDDDC1252719141ECAFB91142B8ECCC8C98A77B |
| localhost | | |
| rhel601 | | |
| hive-mysql | hive | *4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC |
| rhel601 | hive | *4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC |
| rhel601 | hadoop | *B34D36DA2C3ADBCCB80926618B9507F5689964B6 |
| % | hive | *4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC |
+------------+--------+-------------------------------------------+
12 rows in set (0.01 sec)

问题是:现在用另外一个非root的 hadoop用户登录linux系统,然后
[root@rhel601 ~]# mysql -u hive -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'hive'@'localhost' (using password: YES)
提示输入密码后,无法登录

GOOGLE了一些解决办法,没有好使的,还是怎么回事,头大啊,
另外root用户创建的数据库,在linux的hadoop用户怎么才能访问呢?

------解决方案--------------------
[root@rhel601 ~]# mysql -hlocalhost -u hive -p