Focus on cloud service provider activities
Notes on website operation and maintenance

To solve the problem of "# 2002 Unable to log into MySQL server" when logging into phpMyAdmin

Generally, when we manage the website database of the Linux VPS server, most of us use the PHP MYADMIN panel to visually manage the database. In the evening, a netizen told that PHPMYADMIN, which could have logged in, could not log in today, but the website operation was normal, and red appeared when logging in to PHPMYADMIN“ #2002 Unable to log in to MySQL server "You can confirm the password and user without any problem.

 To solve the problem of "# 2002 Unable to log into MySQL server" when logging into phpMyAdmin

It doesn't matter if there is a problem. Let's find and search for solutions. The most direct way is as follows:

First, traverse to the directory where the PHPMYADMIN folder is located in our current website environment

Second, find the config.default.php file

Third, replacement and exchange:

$cfg['Servers'][$i]['host'] = 'localhost';

Replace with

$cfg['Servers'][$i]['host'] = '127.0.0.1';

Fourth, save and replace the file in the server. Restart MYSQL to take effect. You can do it without restarting.

Finally, we can log in to PHPMYADMIN again, and we need to pay attention to one problem here. When we install the website, we configure the server link to be LOCALHOST, and later we need to use 127.0.0.1 as the server link.

Vote for you
Domain name host preferential information push QQ group: six hundred and twenty-seven million seven hundred and seventy-five thousand four hundred and seventy-seven Get preferential promotion from merchants.
Like( zero )
Do not reprint without permission: Lao Zuo's Notes » To solve the problem of "# 2002 Unable to log into MySQL server" when logging into phpMyAdmin