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

qlvxas9a  于 2022-11-09  发布在  PHP
关注(0)|答案(2)|浏览(172)

在安装了lampp(xampp for linux)之后,我得到了一些xampp新的安全异常。

<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的新手,所以我不知道这些东西是如何工作的。请帮助我。

ffdz8vbo

ffdz8vbo1#

所以我觉得你应该这样做:
在/etc/apache 2/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>

`

k10s72fa

k10s72fa2#

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

相关问题