Resolve Login phpMyAdmin The "#2002 unable to log on to the MySQL server" method

Source: Internet
Author: User
Tags php file phpmyadmin vps server
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
Related Article

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.