无法启动LSB:启动和停止mysql数据库服务器守护程序

时间:2018-01-13 05:26:40

标签: mariadb

所以这发生在重启后

sudo systemctl status mysql.service
● mysql.service - LSB: Start and stop the mysql database server daemon
   Loaded: loaded (/etc/init.d/mysql; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since sam 2018-01-13 00:12:28 EST; 10min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 3463 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)

jan 13 00:11:57 miguel systemd[1]: Starting LSB: Start and stop the mysql database server daemon...
jan 13 00:11:58 miguel mysql[3463]:  * Starting MariaDB database server mysqld
jan 13 00:12:28 miguel mysql[3463]:    ...fail!
jan 13 00:12:28 miguel systemd[1]: mysql.service: Control process exited, code=exited status=1
jan 13 00:12:28 miguel systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
jan 13 00:12:28 miguel systemd[1]: mysql.service: Unit entered failed state.
jan 13 00:12:28 miguel systemd[1]: mysql.service: Failed with result 'exit-code'.

3 个答案:

答案 0 :(得分:1)

/etc/init.d/mysql: line 114: /usr/bin/mysqld_safe: No such file or directory

由于某种原因,mysqld_safe丢失了。不知道它去了哪里......

我只是简单地得到删除 - >安装 - > mysql_secure_installation和问题都消失了。

答案 1 :(得分:0)

要检查有关该错误的详细信息,请运行:

$ journalctl -xe

有关该错误的更多详细信息,请检查日志:

$ tail /var/log/mysqld.log 

要初始化MySQL配置,请运行:

$ mysqld --initialize-insecure

答案 2 :(得分:0)

在我的情况下,我在玩配置文件/etc/mysql/my.cnf,却忘记了将指令bind-address = 192.168.1.15更改为动态IP,因为IP更改了,所以它不再能监听该IP。

我这种情况下的解决方案是切换回本地IP (127.0.0.1)或在服务器中设置静态IP。