MySQL启动失败 ,提示错误:code=exited, status=1/FAILURE

Posted Baobob_banana

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL启动失败 ,提示错误:code=exited, status=1/FAILURE相关的知识,希望对你有一定的参考价值。

[root@pc4 mysql]# systemctl status mysqld

● mysqld.service - MySQL Server by xuda

Loaded: loaded (/etc/systemd/system/mysqld.service; enabled; vendor preset: disabled)

Active: failed (Result: exit-code) since Sun 2023-01-22 22:00:27 CST; 58s ago

Docs: man:mysqld(8)

http://dev.mysql.com/doc/refman/en/using-systemd.html

Process: 11790 ExecStart=/application/mysql/bin/mysqld --default-file=/etc/my.cnf (code=exited, status=1/FAILURE)

Main PID: 11790 (code=exited, status=1/FAILURE)

Jan 22 22:00:23 pc4 systemd[1]: Started MySQL Server by xuda.

Jan 22 22:00:27 pc4 systemd[1]: mysqld.service: main process exited, c...RE

Jan 22 22:00:27 pc4 systemd[1]: Unit mysqld.service entered failed state.

Jan 22 22:00:27 pc4 systemd[1]: mysqld.service failed.

Hint: Some lines were ellipsized, use -l to show in full.

看了MySQL的错误日志,发现:

2023-01-22T14:11:12.679082Z 0 [ERROR] [MY-000067] [Server] unknown variable 'default-file=/etc/my.cnf'.

原来是“default-file=/etc/my.cnf”少了一个“s”,应为“defaults-file=/etc/my.cnf”。

修改文件,重新加载

systemctl daemon-reload

启动,成功了

[root@pc4 mysql]# systemctl status mysqld

● mysqld.service - MySQL Server by xuda

Loaded: loaded (/etc/systemd/system/mysqld.service; enabled; vendor preset: disabled)

Active: active (running) since Sun 2023-01-22 22:14:40 CST; 20s ago

Docs: man:mysqld(8)

http://dev.mysql.com/doc/refman/en/using-systemd.html

Main PID: 12125 (mysqld)

Tasks: 38

CGroup: /system.slice/mysqld.service

└─12125 /application/mysql/bin/mysqld --defaults-file=/etc/my.cnf

Jan 22 22:14:40 pc4 systemd[1]: Started MySQL Server by xuda.

以上是关于MySQL启动失败 ,提示错误:code=exited, status=1/FAILURE的主要内容,如果未能解决你的问题,请参考以下文章

运行nodejs项目报Process finished with exit code 1 错误

启动总是提示:Process finished with exit code 0

SpringBoot Idea 启动报错 Process finished with exit code 1

mongoDB重装或升级版本后,启动失败原因及解决方法

Pycharm无法安装第三方库,错误代码Non-zero exit code 的解决方案之pip升级

MySQL 启动报错:Job for mysqld.service failed because the control process exited with error code.