#2002 - The server is not responding (or the local MySQL server#39;s socket is not correctly configured)(#2002 - 服务器没有响应(或者本地 MySQL 服务器的套接字配置不正确))
问题描述
我无法访问 PHPMyAdmin.当我想去那里时,我收到了这个错误:
I can't access to PHPMyAdmin. when i want to go there, i got this error:
#2002 - 服务器没有响应(或本地 MySQL 服务器的套接字配置不正确)
#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)
我用谷歌搜索了这个错误,但不清楚.
I googled this error but it don't clear.
我想知道这段代码打开了哪个端口:
I try to know that which port is open by this code :
pgrep mysql
mysql 运行时打开两个端口.
two ports are open when mysql is running.
我想在我的本地主机中访问 PHPMyAdmin.我正在使用 Ubuntu 操作系统
I want to access to PHPMyAdmin in my localhost. I am using Ubuntu OS
推荐答案
在 Ubuntu 中,默认情况下 mysql
不监听 TCP/IP 连接.它只是使用本地套接字.
In Ubuntu, by default mysql
is not listening to TCP/IP connections. It just uses a local socket.
当前本地套接字配置在 /etc/mysql/my.cnf
中.如果您打开此文件,您应该会发现类似以下内容:
The current local socket is configured in /etc/mysql/my.cnf
. If you open this file, you should find something similar to:
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
你应该做的只是打开PHPMyAdmin
的配置文件(config.inc.php
)并改变socket地址.也许你的 PHPMyAdmin 上没有本地套接字配置,或者它可能不同.该文件应该包含如下一行(当然,将地址调整为您在 my.cnf
上找到的内容):
What you should do is just to open PHPMyAdmin
's config file (config.inc.php
) and change the socket address. Maybe there's no local socket configuration on your PHPMyAdmin, or maybe it is different. This file should contain a line like (of course, adapt the address to what you found on my.cnf
):
$cfg['Servers'][$i]['socket'] = '/var/run/mysqld/mysqld.sock';
这篇关于#2002 - 服务器没有响应(或者本地 MySQL 服务器的套接字配置不正确)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:#2002 - 服务器没有响应(或者本地 MySQL 服务器的套接字配置不正确)


- PHP Count 布尔数组中真值的数量 2021-01-01
- 如何定位 php.ini 文件 (xampp) 2022-01-01
- Mod使用GET变量将子域重写为PHP 2021-01-01
- SoapClient 设置自定义 HTTP Header 2021-01-01
- 带有通配符的 Laravel 验证器 2021-01-01
- 没有作曲家的 PSR4 自动加载 2022-01-01
- Laravel 仓库 2022-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- 正确分离 PHP 中的逻辑/样式 2021-01-01
- 从 PHP 中的输入表单获取日期 2022-01-01