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.

ERROR 1045 (28000) Access Denied for user 'ambari'@'localhost' (using password: yes)

Highlighted

ERROR 1045 (28000) Access Denied for user 'ambari'@'localhost' (using password: yes)

New Contributor

While setting up ambari, I'm using my own instance of mysql. I followed the page to do the Mysql setup. But after creating the user I'm unable to login using that user. It says permission denied. Also tried all the things listed here. But still get the same issue.

1 REPLY 1

Re: ERROR 1045 (28000) Access Denied for user 'ambari'@'localhost' (using password: yes)

Super Mentor

@Swaapnika Guntaka


Can you please share the output of the following command:

# grep 'jdbc' /etc/ambari-server/conf/ambari.properties



Also just want to make double check that you would have followed the below mentioned steps as it is including "FLUSH PRIVILEGES"

# mysql -u root -p
mysql> CREATE DATABASE ambari;
ambari> USE ambari;
ambari> SOURCE /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql



Then

ambari> use mysql;
CREATE USER 'ambari'@'%' IDENTIFIED BY 'bigdata';
GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'%';
CREATE USER 'ambari'@'localhost' IDENTIFIED BY 'bigdata';
GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'localhost';
CREATE USER 'ambari'@'standaloneambari.example.com' IDENTIFIED BY 'bigdata';  <---- Replace the host name 
GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'standaloneambari.example.com';  <---- Replace the host name 
FLUSH PRIVILEGES;




Also please check if your mysql is listening on all addresses:

# netstat -tnlpa | grep 3306
tcp  0  0 :::3306  :::*  LISTEN  314/mysqld   




Also please double check your Ambari Server Hostname (FQDN) to verify that it has proper entry inside it's /etc/hosts file.

# cat /etc/hosts
# hostname -f


Setting up proper FQDN is one of the requirement for ambari managed cluster.

.