刚装好的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后, 启动的时候会去检查这个. 但是却不会给出明显的地址错误