启动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. BFS与DFS模板

    搜索问题的解法 DFS(深度优先搜索) BFS(广度优先搜索) backtracking(回溯) DFS模板 void dfs(...) { // 结束递归的条件 if (...) { ..... / ...

  2. P1828 香甜的黄油 Sweet Butter (spfa)

    题目描述 农夫John发现做出全威斯康辛州最甜的黄油的方法:糖.把糖放在一片牧场上,他知道N(1<=N<=500)只奶牛会过来舔它,这样就能做出能卖好价钱的超甜黄油.当然,他将付出额外的费 ...

  3. [剑指offer] 41. 数据流中的中位数 (大小堆,优先队列)

    对于海量数据与数据流,用最大堆,最小堆来管理. class Solution { public: /* * 1.定义一个规则:保证左边(大顶堆)和右边(小顶堆)个数相差不大于1,且大顶堆的数值都小于等 ...

  4. Python面向对象之静态方法、静态方法与类方法

    静态属性: 类调用函数属性时,需要先将类实例化,再将实例作为函数属性传入:类的实例调用函数属性时需要在后面加括号. class Building: def __init__(self, name, o ...

  5. Java基础学习总结(63)——Java集合总结

    数据结构是以某种形式将数据组织在一起的集合,它不仅存储数据,还支持访问和处理数据的操作.Java提供了几个能有效地组织和操作数据的数据结构,这些数据结构通常称为Java集合框架.在平常的学习开发中,灵 ...

  6. Git学习总结(4)——我的Git忽略文件

    *.bak *.txt *.vm .gitignore #svn .svn/ # built application files *.apk *.ap_ # files for the dex VM ...

  7. Sping面试题分析

    1.开放中主要使用Spring的什么技术? (1)IOC容器管理各层的组件 (2) 使用AOP配置声明式事务 (3)整合其他框架 2简述AOP和IOC概念 AOP : Aspect  Orienten ...

  8. 精美viso制图(1)

    office组件中的viso是一款十分强大的绘图工具,在绘制流程图.结构框图时显得十分方便,这里将我自己绘制的一些viso图(大部分都是用在我自己的论文中的)与大家分享一把. 1.深度学习训练流程图 ...

  9. Codeforces Round #316 (Div. 2)E. Pig and Palindromes DP

    E. Pig and Palindromes   Peppa the Pig was walking and walked into the forest. What a strange coinci ...

  10. 英语发音规则---V字母

    英语发音规则---V字母 一.总结 一句话总结: 1.V发[v]? voice [vɒɪs] n. 声音 love [lʌv] n. 恋爱 leave [liːv] vt. 离开 very ['ver ...