mysqld 与 mysql 套接字文件

mysqld 与 mysql 套接字文件

我无法通过 phpmyadmin 连接到 mysql。我可以调出登录页面,但当我尝试登录时,出现以下 4 个错误:

 #2002 - Connection refused — The server is not responding (or the local server's socket is not correctly configured).
 mysqli_real_connect(): (HY000/2002): Connection refused
 Connection for controluser as defined in your configuration failed.
 mysqli_real_connect(): (HY000/2002): Connection refused

所以我一直在尝试找出问题所在。我确实注意到,mysql.cnf除了这两行之外,我的是空的:

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/

我不知道!在这方面是什么意思,但我认为它的意思是使用这两个文件。

我走进去/etc/mysql/mysql.conf.d/mysqld.cnf,我看到

# * Basic Settings
#
user        = mysql
pid-file    = /var/run/mysqld/mysqld.pid
socket      = /var/run/mysqld/mysqld.sock
port        = 3306
basedir     = /usr
datadir     = /var/lib/mysql
tmpdir      = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address        = 127.0.0.1

本地服务器套接字的配置有什么问题吗?还是我找错了地方?

相关内容