In general, when we manage the Linux VPS Server Web site database, most of them use the phpMyAdmin panel to visualize the management database. At night a netizen told the original can login phpMyAdmin today, but the website operation is normal, login phpmyadmin when there are red "#2002 unable to log on to the MySQL server" error prompts, to determine the password and the user is no problem.
Problems do not matter, we go to find and search for solutions, the most direct way is as follows:
First, traverse to our current Web site environment in the directory where the phpMyAdmin folder
Second, find the config.default.php file
Third, replacement exchange:
The code is as follows |
Copy Code |
$cfg [' Servers '] [$i] [' host '] = ' localhost ';
More change
$cfg [' Servers '] [$i] [' host '] = ' 127.0.0.1 ';
|
Four, save and replace the file in the server, restart MySQL effective, do not reboot can also.
Finally, we login phpMyAdmin can be normal landing, here need to pay attention to a problem, we install the site, configure the server link originally is localhost, later need to use 127.0.0.1 as a server link