Created on 07-11-2018 05:42 PM - edited 09-16-2022 06:27 AM
Hi I am a newbie to HDP, I downloaded the HDP and run with virtualbox. However, when i tried to access the mysql database for the first time after ssh into the sandbox VM, I encountered the following error:
[root@sandbox-hdp ~]# mysql -uroot
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Originally I thought that maybe mysql does require any password for the first time login, therefore i tried to use "hadoop" as the password as suggested in some of the posts i googled, but again the access was denied:
[root@sandbox-hdp ~]# mysql -uroot -phadoop
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
I have also followed this post https://community.hortonworks.com/questions/86949/error-1045-28000-access-denied-for-user-root.html but the suggested solution was not working for me:
I even tries other means such as
[root@sandbox-hdp ~]# mysql -root -h 0.0.0.0
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
I am using the latest HDP sandbox which is version 2.6.5
[root@sandbox-hdp ~]# sandbox-version
== Sandbox Information ==
Platform: hdp-security
Build date: 06-18-2018
Ambari version: 2.6.2.0-155
Hadoop version: Hadoop 2.7.3.2.6.5.0-292
OS: CentOS Linux release 7.5.1804
Any help will be appreciated
Created 07-12-2018 04:17 PM
Many thanks for the suggestions from Eric and Sai, I think there may be something wrong with my mysql root access as Eric's suggestion not working for me either:
[root@sandbox-hdp ~]# mysql -uroot -phadoop -hlocalhost
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
I ended up reset the password using the following approach
systemctl stop mysqld
systemctl set-environment MYSQLD_OPTS="--skip-grant-tables --skip-networking"
systemctl start mysqld
mysql -uroot
Once in the mysql, run:
FLUSH PRVILEGES;
UPDATE PASSWORD FOR root@'localhost'=PASSWORD('hadoop')
FLUSH PRIVILEGES;
QUIT;
Once log out from mysql, clear the environment MYSQLD_OPTS and restart mysql server
systemctl unset-environment MYSQLD_OPTS
systemctl restart mysqld
mysql -uroot -phadoop
Created 08-31-2018 03:40 PM
Hello @Ram B, you need to set your new password in the hive metastore also.
You can make it through Ambari UI: Login to the Ambari Dashboard --> click on hive --> Configs --> then Advanced -->under Hive Metastore section --> change the password (your root new password) --> then restart All. Now hive should be working with no problems.
Created 09-01-2018 02:02 AM
Thanks Sagar and Ryad.
I changed mysql root password to 'hortonworks1', then hive metastore started working. After that i can change ambari dashboard->hive->configs->advanced password change (before that it was grayed out cannot change the password). Another point when i change the password in ambari->hive, i need to change root password in mysql login also.