When phpMyAdmin prompts "Accessdeniedforuser 'root' @ 'localhost' (usin

Source: Internet
Author: User
Today, when I used phpMyAdmin to connect to a database in MySQL, I encountered the following prompt: #1045

Today, when I use phpMyAdmin to connect to a database in MySQL, the following message is displayed: #1045-Access denied for user.

I. Error content

Today, when I use phpMyAdmin to connect to a database in MySQL, the following message is displayed:

#1045-Access denied for user 'root' @ 'localhost' (using password: NO)

PhpMyAdmin tries to connect to the MySQL server, but the server rejects the connection. Check the host, user name, and password in config. inc. php and confirm that the information is consistent with the information given by the administrator of the MySQL server.

Ii. solution:

Open config. inc. php and you can see that there are two rows in it, which is the key to the problem:

$ Cfg [] [$ I] [] =; $ cfg [] [$ I] [] = '';

This is generally the default setting in phpmyadmin. the user name is root and the password is blank. When the local machine establishes a mysql database, it can be directly connected.

Therefore, the connection will be successful when phpmyadmin is used for the first time, but why is it prompted to reject the connection? Because the root password (or other user names) has been modified, it can be changed in the command line or in phpmyadmin:

Procedure:

Open phpmyadmin --> User --> (root-localhost)-edit permission

If the password is set, the following logon password must be modified at the same time. Otherwise, it is useless to change the configuration file config. inc. php. Because the default password is blank, the connection is rejected after the connection is added. Now we can see that the two lines of code are the username and password in the login information:

$ Cfg [] [$ I] [] =; $ cfg [] [$ I] [] = '';

If it is left blank, the error message is (using password: NO). If you have knocked on the changed password, you can log on successfully.

PhpMyAdmin details: click here
PhpMyAdmin: click here

Recommended reading:

Install the LAMP \ Vsftpd \ Webmin \ phpMyAdmin service and settings in Ubuntu 13.04

Example of LAMP architecture collaborative application-phpMyAdmin

PhpMyAdmin and Wordpress for LAMP applications

PhpMyAdmin logon timeout Solution

Install phpMyAdmin and Adminer in Ubuntu

Implement SSL functions based on LAMP and install phpMyAdmin

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.