I am using sandbox image HDF_184.108.40.206_virtualbox_28_11_2017.ova. I am trying to enable hive and start hive metadata database using mysql. I can't create database/user because I can't login in as root. I have tried empty password, hadoop, admin, hive, root, etc. Keep getting the same ERROR 1045 ( 28000): Access denied for user 'root'@'localhost'. Please let me know how I should proceed. Thanks
After you run the "mysql -u root -p" command when it asks for password please enter "hadoop" as password.
# mysql -u root -p Enter password: hadoop
- Operating System password and MySQL passwords can be different.
But if you have changed mysql root password then you might want to look at the following link which talks about If you assigned a
rootpassword previously but have forgotten it, you can assign a new password.
Please check your MySQL version. If it is 5.7 or above then A temporary password is generated. Which can be found inside it's log:
# sudo grep "temporary password" /var/log/mysqld.log
For more detailed answer on "skip-grant-tables" and resetting root password for mysql please refer to:
I tried 'hadoop' password -> not working
I tried sudo grep "temporary password" /var/log/mysqld.log -> not working
I tried https://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html and I ended up with https://stackoverflow.com/questions/25700971/fatal-error-please-read-security-section-of-the-manual-... -> not working
Why on a sandbox I need a CIA/FBI hidden password for mysql ?! is it so important ?
ANY OTHER IDEAS ?
Ok after spending 1/2 day here what I did :
1- Find Ambaris password location :
shell> grep "password" /etc/ambari-server/conf/ambari.properties
2- The output from previous command:
3- Cat password.dat
[root@sandbox-hdp conf]# cat /etc/ambari-server/conf/password.dat //output is 'bigdata' from this command
4- Enter Ambaris postgreSQL db
bigdata[root@sandbox-hdp psql -U ambari Password for user ambari: psql (9.2.23) Type "help" for help. ambari=>
5- Execute the select:Expanded display is on. ambari=> select config_id,type_name,config_data from clusterconfig where type_name='hive-site' ORDER BY config_id DESC LIMIT 1;
6- From the output search for:"javax.jdo.option.ConnectionPassword":"hortonworks1"
here you can find all the steps to change the root password:
1. Stop mysql: systemctl stop mysqld 2.Set the mySQL environment option systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"3.Start mysql usig the options you just set systemctl start mysqld 4. Login as root mysql -u root 5.Update the root user password with these mysql commands mysql>UPDATE mysql.userSET authentication_string = PASSWORD('MyNewPassword')->WHEREUser='root'AND Host ='localhost'; mysql> FLUSH PRIVILEGES; mysql> quit *** Edit ***As mentioned my shokulei in the comments,for5.7.6and later, you should use mysql>ALTERUSER'root'@'localhost' IDENTIFIED BY'MyNewPass';Or you'll get a warning 6. Stop mysql systemctl stop mysqld 7. Unset the mySQL envitroment option so it starts normally next time systemctl unset-environment MYSQLD_OPTS 8.Start mysql normally: systemctl start mysqld Try to login using your new password:7. mysql -u root -p