phpMyAdmin connection MySQL appears 2002 server is not responding

Source: Internet
Author: User
Tags phpmyadmin

Yesterday, when using phpMyAdmin to connect to MySQL, there was a #2002– server that was not responding (or the socket for the local MySQL server was not configured correctly), but I did not have any problems with the PHP connection.

The code is as follows Copy Code

<?php
$link =mysql_connect ("127.0.0.1", "root", "password");
if (! $link) echo "Connect error";
else echo "Connect OK";
?>

Later wanted to phase MySQL the address of the database server should be changed to 127.0.0.1,

Specific methods:

Open the config.inc.php we just copied to the phpMyAdmin directory.

Find this phrase:

The code is as follows Copy Code

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

Change into

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

This can be the cause of this problem I think it should be the host file resolution problem, we deal with one should be good.

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.