启动MySQL时抛出:

Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.

提示说使用journalctl -xe查看详细日志

[linga@localhost ~]$ journalctl -xe
-- Subject: Unit mysqld.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysqld.service has begun starting up.
Aug 30 04:32:12 localhost.localdomain mysqld[2312]: Initialization of mysqld failed: 0
Aug 30 04:32:12 localhost.localdomain systemd[1]: mysqld.service: control process exited, code=exited status=1
Aug 30 04:32:14 localhost.localdomain systemd[1]: Failed to start MySQL Server.
-- Subject: Unit mysqld.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysqld.service has failed.
--
-- The result is failed.
Aug 30 04:32:14 localhost.localdomain systemd[1]: Unit mysqld.service entered failed state.
Aug 30 04:32:14 localhost.localdomain systemd[1]: mysqld.service failed.
Aug 30 04:32:14 localhost.localdomain systemd[1]: mysqld.service holdoff time over, scheduling restart.
Aug 30 04:32:14 localhost.localdomain systemd[1]: Starting MySQL Server...
-- Subject: Unit mysqld.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysqld.service has begun starting up.
Aug 30 04:32:14 localhost.localdomain mysqld[2359]: Initialization of mysqld failed: 0
Aug 30 04:32:14 localhost.localdomain systemd[1]: mysqld.service: control process exited, code=exited status=1
Aug 30 04:32:16 localhost.localdomain systemd[1]: Failed to start MySQL Server.
-- Subject: Unit mysqld.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysqld.service has failed.
--
-- The result is failed.
Aug 30 04:32:16 localhost.localdomain systemd[1]: Unit mysqld.service entered failed state.
Aug 30 04:32:16 localhost.localdomain systemd[1]: mysqld.service failed.

发现时进程已经存在了,MySQL的进程pid是3306,于是想着杀掉该进程:

kill 3306

发现报错了,于是在cat /etc/my.cfg中查看配置

最后发现设置字体编码时弄错配置了,导致启动失败的;

[linga@localhost ~]$ kill 3306
-bash: kill: (3306) - No such process
[linga@localhost ~]$ cat /etc/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html [mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock # Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0 log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid # Add UTF-8
character_set=utf8
init_connect='SET NAMES utf8'
[linga@localhost ~]$ sudo vim /etc/my.cnf
[sudo] password for linga:
[linga@localhost ~]$ sudo systemctl start mysqld
[linga@localhost ~]$ sudo systemctl status mysqld
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2018-08-30 04:41:33 EDT; 12s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 14018 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
Process: 14001 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 14021 (mysqld)
CGroup: /system.slice/mysqld.service
└─14021 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid Aug 30 04:41:32 localhost.localdomain systemd[1]: mysqld.service holdoff time over, scheduling restart.
Aug 30 04:41:32 localhost.localdomain systemd[1]: Starting MySQL Server...
Aug 30 04:41:33 localhost.localdomain systemd[1]: Started MySQL Server.

启动失败大多都是由于配置文件配置出错了才启动不起来,一定要提前备份好配置文件

Job for mysqld.service failed because the control process exited with error code的更多相关文章

  1. Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.

    一.前言 Job for mysqld.service failed because the control process exited with error code. See "sys ...

  2. Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details

    thinkphp 在Apache上配置启用伪静态,重启Apache1 restart 竟然失败了,报错 Job for httpd.service failed because the control ...

  3. CentOS启动docker1.13失败(Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.)

    一.启动失败 1.启动docker [root@localhost ~]# systemctl start docker Job for docker.service failed because t ...

  4. Job for network.service failed because the control process exited with error code

    转自:https://blog.csdn.net/dongfei2033/article/details/81124465 今天在centOS 7下更改完静态ip后发现network服务重启不了,翻遍 ...

  5. Centos7 网络报错Job for iptables.service failed because the control process exited with error code.

    今天在进行项目联系的时候,启动在待机的虚拟机,发现虚拟机的网络设置又出现了问题. 我以为像往常一样重启网卡服务就能成功,但是它却报了Job for iptables.service failed be ...

  6. docker 报错: Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.

    centos 启动docker服务报错: Job for docker.service failed because the control process exited with error cod ...

  7. Job for ssh.service failed because the control process exited with error code.......

    转载自:https://blog.csdn.net/woailyoo0000/article/details/79782986 笔者最近更新ubuntu系统,在更新之前设置了证书信任文件,重启以后ss ...

  8. Linux 重启网卡失败 Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.

    linux下重启网卡使用命令 : service network restart 时报错: [root@slave01 hadoop]# service network restart Startin ...

  9. Job for php-fpm.service failed because the control process exited with error code. See "systemctl status php-fpm.service" and "journalctl -xe" for details.

    [root@web01 ~]#  systemctl start php-fpm Job for php-fpm.service failed because the control process ...

随机推荐

  1. Oracle语句执行顺序

  2. 【JavaScript框架封装】数据类型检测模块功能封装

    数据类型检测封装后的最终模块代码如下: /*数据类型检验*/ xframe.extend(xframe, { // 鸭子类型(duck typing)如果它走起路来像鸭子,叫起来也是鸭子,那么它就是鸭 ...

  3. MyBatis中的大于号小于号表示

    可以使用转义字符把大于号和小于号这种直接替换掉: select* from table where '字段1'>=10怎么表示,问题来啦 xml转义可以使用 根据这个规则上面的sql写法应该变成 ...

  4. 如何指定GCC的默认头文件路径

    如何指定GCC的默认头文件路径 网上偶搜得之,以之为宝:)原地址:http://blog.chinaunix.net/u/28781/showart.php?id=401631============ ...

  5. jsp三层架构

    学了.net了,它的三层架构很好用.现在学jsp,我们一样可以用三层架构来开发.下面详细介绍 1.创建数据库 drop table MyUser create table MyUser ( id ,1 ...

  6. 2015 Multi-University Training Contest 6 hdu 5357 Easy Sequence

    Easy Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)T ...

  7. 机房工程-在线式、后备式UPS选择(转载)

    原文网址:http://oa.yesky.com/10/31061510all.shtml#p31061510 1后备式UPS还是在线式UPS? 作为机房设备的一项重要保护措施,UPS起着无可替代的作 ...

  8. poi读取合并单元格

    poi读取合并单元格 学习了:http://blog.csdn.net/ycb1689/article/details/9764191 进行了列合并单元格的修正:原来是我自己找错了地方: import ...

  9. 【jQuery】对于复选框操作的attr与prop

    这个是在jQuery1.6版本号之后出现的鬼东西.受影响的主要有下拉列表select与复选框checkbox.众所周知.在jQuery中能够用attr()取出节点的属性,然而对于checkbox却不是 ...

  10. 【Android 系统开发】使用 Source InSight 阅读 Android 源代码

    1. 安装 Source Insight (1) Source Insight 相关资源 安装相关资源 : -- 下载地址 : http://www.sourceinsight.com/down35. ...