Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Access denied for user 'ambari'@localhost (using password: YES)

Solved Go to solution
Highlighted

Re: Access denied for user 'ambari'@localhost (using password: YES)

Super Mentor

@yassine sihi

Thanks for sharing the solution to check the password file first.

[root@sandbox ~]# cat /etc/ambari-server/conf/password.dat
bigdata
Highlighted

Re: Access denied for user 'ambari'@localhost (using password: YES)

Super Mentor

@yassine sihi

It looks like the GRANT for "ambari' user are not properly set inside the DB.

Can you please share the output of the following SQL query from the Database. You can login as "root" user inside the DB and then run the command;

mysql> select User,Password,Host from mysql.user;

.

Also update the "ambari" suer password using the following command:

mysql>  UPDATE user SET Password=PASSWORD('bigdata') where USER='ambari'; 
mysql>  FLUSH PRIVILEGES;

.

Then restart Ambari Server.

Highlighted

Re: Access denied for user 'ambari'@localhost (using password: YES)

Expert Contributor

@Jay Kumar SenSharma

Ok, This is the output after running UPDATE query:

42461-ex.jpg

Highlighted

Re: Access denied for user 'ambari'@localhost (using password: YES)

Super Mentor

@yassine sihi

In the above screenshot the "password" column for user "ambari" is Empty where the Host is "10.166.2.206" which should be set to password.

 UPDATE user SET Password=PASSWORD('bigdata') where USER='ambari';

.

And then the Grant need to be provided to the user.

<br>mysql> use mysql;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'localhost'; 
mysql> GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'s1xxxxxxxxxxxx';    <--- correct hostname
mysql> GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'10.166.2.206'; 
mysql> FLUSH PRIVILEGES;

.

Highlighted

Re: Access denied for user 'ambari'@localhost (using password: YES)

Expert Contributor

@Jay Kumar SenSharma

I don't think that's the issue because i have already done it.

thanks Jay

Re: Access denied for user 'ambari'@localhost (using password: YES)

Expert Contributor

I think that i found the solution:

when i started the ambari installation, I stupidly change the default password which is bigdata to an other

So when the server goes to start it retrieve the password which is inside /etc/ambari-server/conf/password.dat in order to connect to Mysql which is obviously not the same.

I forced the change of the password in the path: /etc/ambari-server/conf/password.dat and then it works fine

thanks @Jay Kumar SenSharma

View solution in original post

Don't have an account?
Coming from Hortonworks? Activate your account here