Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

What is the MySQL root-password from Hive-Install?

avatar
Explorer

Hello,

for this fix I need root access to the mysql-instance on the node where Hive is running.
But I noticed, that I set it nowhere during the installation-process?! Not during ambari-installation and not during the HDP-installation. I just set the Hive-DB-password (!= root-password).
When I try to execute the suggested command in the SO-question above (mysql -u root -p -hlocalhost) the Hive-password doesn't work. Also the default password 'admin' doesn't work.

So, is there a trick, whats the password? Or did I do a mistake? I'd like to have full access and control over my cluster and the included components ;D

Thanks,
Warius

1 ACCEPTED SOLUTION

avatar
Master Mentor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
5 REPLIES 5

avatar
Master Mentor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar
Master Mentor

@Warius Unnlauf

After login in to the DB just in case you want to change the "root" user password then you might want to run:

mysql>  UPDATE user SET Password=PASSWORD('what_ever_you_want') where USER='root'; 

.

avatar
Explorer

Oh, sorry, forgot to mention, I also tried this, and the same error as on the other attempts appears:

[usr@HOST ~]$ mysql -u root -p -hlocalhost
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

avatar
Master Mentor

@Warius Unnlauf


Please do not specify the "-hlocalhost" (Or try using the actual hostname instead of "localhost')

Please run the mysql command from the host where the hive (mysql DB) is installed.

[root@blueprint2 ~]# mysql -u root -p
Enter password: <Just Press Enter Key empty password>

.

Else you will have to gran the *.* privilege to the 'root'@'localhost'

Please try this:

Step1). Edit the following file "/etc/my.cnf" and then set the "skip-grant-tables" as following:

[mysqld]
skip-grant-tables
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
.
.
<br>

2. Restart the mysql.

# service mysqld restar

3. Now login to mysql:

[root@blueprint2 ~]# mysql -urootmysql 

4. Now reset the password.

mysql> UPDATE user SET Password=PASSWORD('redhat') where USER='root'; 
Query OK, 7 rows affected (0.02 sec)
Rows matched: 7  Changed: 7  Warnings: 0

mysql> FLUSH PRIVILEGES; 
Query OK, 0 rows affected (0.00 sec)<strong></strong>

.

.

avatar
Master Mentor

@Warius Unnlauf

mysql> SELECT User, Host, Password FROM mysql.user;
+------+------------+-------------------------------------------+
| User | Host       | Password                                  |
+------+------------+-------------------------------------------+
| root | localhost  |                                           |
| root | blueprint2 |                                           |
| root | 127.0.0.1  |                                           |
| root | ::1        |                                           |
| hive | %          | *4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC |
+------+------------+-------------------------------------------+

Reference: https://www.rosehosting.com/blog/mysql-show-users/