Phpmyadmin访问被拒绝

时间:2014-04-11 03:43:09

标签: phpmyadmin wampserver

错误 MySQL说:文档

2002 - 无法建立连接,因为目标计算机主动拒绝它。

服务器没有响应(或者未正确配置本地服务器的套接字)。

1 个答案:

答案 0 :(得分:2)

通常这是因为您的浏览器获得了本地主机IP地址的IPV6版本,并且未设置phpMyAdmin配置以允许该地址访问。

修改\wamp\alias\phpmyadmin.conf并将其更改为:

如果您使用的是Apache 2.2.x

<Directory "d:/wamp/apps/phpmyadmin3.5.1/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
</Directory>

<Directory "d:/wamp/apps/phpmyadmin3.5.1/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1 localhost ::1
</Directory>

如果您使用的是Apache 2.4.x

改变它
<Directory "d:/wamp/apps/phpmyadmin4.0.4/">
    Options Indexes FollowSymLinks ExecCGI
    AllowOverride all
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
    Allow from ::1
    Allow from localhost
</Directory>

<Directory "d:/wamp/apps/phpmyadmin4.0.4/">
    Options Indexes FollowSymLinks ExecCGI
    AllowOverride all
    Require local
</Directory>