ERROR 1044 (42000): Access denied for user "@ ' localhost ' to database ' Ambari '

Source: Internet
Author: User

Configuring Ambari remote maridb error:

ERROR 1044 (42000): Access denied for user "@ ' localhost ' to database ' Ambari '

In the process of building the environment, the

# Log in toMySQL with Ambari User (user set above) ( no password )

Mysql-u ambari-p

Use Ambari;

Source/var/lib/ambari-server/resources/ambari-ddl-mysql-create.sql

Encountered the following:

ERROR 1044 (42000): Access denied for user "@ ' localhost ' to database ' Ambari ';

background: Because you have previously installed MySQL, and then uninstall MySQL, and then install the mariadb.

preliminary judgment may be that no databases was created, or the password was wrong, or configuration information such as MARIADB remote connection was not configured (MY.CNF)

Follow the logic of thinking to verify the first question:

to the root user, try logging in to see if there is a Ambari database:

[Email protected] ~]# Mysql-uroot–proot

MariaDB [(None)]> show databases;

+--------------------+

| Database |

+--------------------+

| Activity |

| Ambari |

| Amon |

| CM |

| Hive |

| Huedefault |

| Information_schema |

| MySQL |

| Oozie |

| Ooziedefault |

| Performance_schema |

| Python |

+--------------------+

as shown above, there is a Ambari database.

In the face of the second question, my solution is:

Mysql-uambari–p

Directly hit Enter, no password:

Show:

MariaDB [(None)]> show databases;

+--------------------+

| Database |

+--------------------+

| Information_schema |

+--------------------+

1 row in Set (0.00 sec)

This is not the answer to the question:

The Final Solution: It took 1 hours and a minute to resolve the BUG.

The right idea: a privilege issue.

Log in to mariadb with root privileges .

MariaDB [(None)]> SELECT host,user,password,grant_priv,super_priv from Mysql.user;

+-----------+--------+-------------------------------------------+------------+------------+

| Host | user | password | Grant_priv | Super_priv |

+-----------+--------+-------------------------------------------+------------+------------+

| localhost | Root | *81f5e21e35407d884a6cd4a731aebfb6af209e1b | Y | Y |

| 127.0.0.1 | Root | *81f5e21e35407d884a6cd4a731aebfb6af209e1b | Y | Y |

| :: 1 | Root | *81f5e21e35407d884a6cd4a731aebfb6af209e1b | Y | Y |

| %         | Ambari | *81f5e21e35407d884a6cd4a731aebfb6af209e1b | Y | Y |

| %         | Hive | *6b992dd2d480f43212f044ab3ecaf17e1ea056b9 | N | Y |

| %         | Oozie | *2f2e0d3ad70093ddb3f8964e3984ea04b40a6d3c | N | Y |

+-----------+--------+-------------------------------------------+------------+------------+

6 rows in Set (0.00 sec)

at this point the Ambari user's grant_priv permission is N ( the figure is Y because the modified solution )

Enter sql:

UPDATE mysql.user SET grant_priv= ' y ', super_priv= ' y ' WHERE user= ' Ambari ';

then use ambari User Login, enter the password successfully.

ERROR 1044 (42000): Access denied for user "@ ' localhost ' to database ' Ambari '

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.