启动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. 研究发现:TLS1.3中的 TLS 对话恢复机制可以追踪用户

    由于隐私浏览器技术的日渐成熟,网站越来越无法通过 Cookie 和网页浏览器特征来追踪用户,但道高一尺魔高一丈,现在这些网站会用 TLS 1.3 中的 TLS 对话恢复机制追踪用户. 你以为禁用浏览器 ...

  2. List或者Map等对象创建语句放在循环外和循环内的区别

    每一个对象创建的时候都会有一个ID,List对象在执行add方法的时候是将对象的引用放入List中. 如果把创建Map对象的语句放在外面,在将对象add到List中时,前后向List中add的对象都是 ...

  3. 数据库之JDBC入门

    数据表: 代码实现(注:jar包用的8.0版本) import java.sql.*; import java.util.Scanner; public class MyDatabase { publ ...

  4. IDEA热部署配置

    一.IDEA热加载的作用: 热加载的作用就是当你保存修改,新增,删除代码或者文件后,不需要重新启动项目,直接就能运行. 二.IDEA热记载的配置方法 1.配置pom文件,加载依赖 Maven. < ...

  5. VS2015使用C++编写DLL,并在C#环境中调用【转】

    说明:本文是本人在学习封装DLL时看到的,觉得说得很清楚,为了防止忘记,特意复制下来学习用,原文链接:https://blog.csdn.net/songyi160/article/details/5 ...

  6. js获取日期当天的开始时间和结束时间

    //函数调用传参格式为 2018-6-6或者2018.6.6//如:startUnix(2018-6-6) 返回的时间戳格式‘1528300799’ function startUnix($date) ...

  7. Activiti 各个节点涉及的表

    ################################# 部署流程定义涉及到的表 # 流程部署表SELECT * FROM `act_re_deployment` # 流程定义表SELECT ...

  8. Swift入门(四)——可选类型(Optionals)与断言(Assert)

    可选类型是什么? 首先看一个问题,Swift中String类型的变量有一个叫做toInt的方法,能够把String类型变量转换为Int类型变量. var stringValue = "5&q ...

  9. Spring使用HibernateDaoSupport操作数据

    spring提供了一个数据訪问层的类:org.springframework.orm.hibernate3.support.HibernateDaoSupport.一般是让 dao继承该类,然后在da ...

  10. android创建桌面快捷键shortcut

    有非常多人也写过创建桌面快捷键的blog.可是大部分都仅仅讲了怎么用,事实上技术使用起来都非常easy.可是你使用后下次还知道吗? 根本原因还是不清楚原理.今天我就来讲讲shortcut创建过程. 过 ...