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