当前位置: 代码迷 >> 综合 >> Debian (Jessie 8.0) mysql can't connect to local mysql server through socket '/var/run/mysqld/mysqld
  详细解决方案

Debian (Jessie 8.0) mysql can't connect to local mysql server through socket '/var/run/mysqld/mysqld

热度:39   发布时间:2023-12-08 03:03:08.0

刚装好的debian8  jessie, apt-get了mysql-server后, 发现没启起来.

root@debian:~# systemctl status mysql.service 
● mysql.service - LSB: Start and stop the mysql database server daemonLoaded: loaded (/etc/init.d/mysql)Active: failed (Result: exit-code) since Thu 2015-09-10 00:39:04 CST; 10s agoProcess: 2618 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)Sep 10 00:39:04 debian mysql[2618]: Starting MySQL database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!
Sep 10 00:39:04 debian systemd[1]: mysql.service: control process exited, code=exited status=1
Sep 10 00:39:04 debian systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
Sep 10 00:39:04 debian systemd[1]: Unit mysql.service entered failed state.

提示是守护进程没起来导致的


解决就很简单了, 把守护进程重启下

#/usr/bin/mysqld_safe &
再重启下mysql 就好了

#systemctl restart mysql.service

如果还是启动不起来. 检查下配置文件. /etc/mysql/my.cnf 是不是有错误.

尤其是bind-address, 因为bind后, 启动的时候会去检查这个. 但是却不会给出明显的地址错误

  相关解决方案