PhpMyAdmin访问被拒绝#2002 Ubuntu,Lampp(Xampp for ubuntu)

时间:2013-11-26 06:22:16

标签: php mysql linux ubuntu phpmyadmin

安装lampp(xampp for linux)之后,我得到了一些xampp新安全异常。为此,我更改了http-xampp.conf文件,如下所示

<Directory "/opt/lampp/phpmyadmin">
    AllowOverride AuthConfig Limit
    Order allow,deny
    Allow from all
    Require all granted
</Directory>

之后我得到了拒绝访问权限的问题,其中显示如下,

Error
MySQL said: Documentation

#2002 - No such file or directory
The server is not responding (or the local server's socket is not correctly configured). 

Connection for controluser as defined in your configuration failed.

我已经从ubuntu论坛尝试了很多东西,但无法解决它。由于我是ubuntu的新手,我无法理解这些东西是如何工作的。请帮忙。

2 个答案:

答案 0 :(得分:0)

所以我觉得你应该这样做:

在/etc/apache2/conf.d /

中创建一个文件phpmyadmin.conf

将此内容写入该文件:

`

# phpMyAdmin default Apache configuration

Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>
    Options FollowSymLinks
    DirectoryIndex index.php

    <IfModule mod_php5.c>
        AddType application/x-httpd-php .php

        php_flag magic_quotes_gpc Off
        php_flag track_vars On
        php_flag register_globals Off
        php_admin_flag allow_url_fopen Off
        php_value include_path .
        php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
        php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext
    </IfModule>

</Directory>

# Authorize for setup
<Directory /usr/share/phpmyadmin/setup>
    <IfModule mod_authn_file.c>
    AuthType Basic
    AuthName "phpMyAdmin Setup"
    AuthUserFile /etc/phpmyadmin/htpasswd.setup
    </IfModule>
    Require valid-user
</Directory>

# Disallow web access to directories that don't need it
<Directory /usr/share/phpmyadmin/libraries>
    Order Deny,Allow
    Deny from All
</Directory>
<Directory /usr/share/phpmyadmin/setup/lib>
    Order Deny,Allow
    Deny from All
</Directory>

`

答案 1 :(得分:-1)

更改mysql的端口号。我的默认值是3306,该端口可能正在使用中,因此将端口号更改为3307或其他一些数字