1.启动命令

systemctl start mysqld.service 或者 /etc/init.d/mysqld start   结果同样的错误

2.错误是:

Job for mysqld.service failed. See 'systemctl status mysqld.service' and 'journalctl -xn' for details.

3.按照提示输入命令

systemctl status mysqld.service 或者 journalctl -xn

命令后提示:

mysqld.service - SYSV: MySQL database server.
    Loaded: loaded (/etc/rc.d/init.d/mysqld)
    Active: failed (Result: exit-code) since Tue 2017-03-14 09:00:45 CST; 9s ago
  Process: 2550 ExecStart=/etc/rc.d/init.d/mysqld start (code=exited, status=1/FAILURE)
  Starting SYSV: MySQL database server....
  MySQL Daemon failed to start.
Starting mysqld:  [FAILED]
mysqld.service: control process exited, code=exited status=1
Failed to start SYSV: MySQL database server..
Unit mysqld.service entered failed state.

4.进一步查看日志:

vi /var/log/mysqld.log

如下:

[ERROR] /usr/sbin/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2 - No such file or directory)
[ERROR] Can't start server: can't create PID file: No such file or directory

5.创建该目录

mkdir -p /var/run/mysqld/

6.启动mysql服务

/etc/init.d/mysqld start

错误和原来一致

7.查看日志:

如下:

[ERROR] /usr/sbin/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 13 - Permission denied)
          [ERROR] Can't start server: can't create PID file: Permission denied

8.授权

chown mysql.mysql /var/run/mysqld/

9.启动

/etc/init.d/mysqld start
      Starting mysqld (via systemctl):                           [  OK  ]
————————————————
版权声明:本文为CSDN博主「loveuserzzz」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/loveuserzzz/article/details/62036988

centos7 mysql 启动mysqld.service - SYSV: MySQL database server错误的更多相关文章

  1. Mysql启动找不到mysql.sock文件问题(Centos7)

    刚装完Mysql5.7,将Mysql添加到开机自启.reboot之后mysql服务却没启动起来, 直接输入mysql –uroot –p ,出现如下错误,找不到mysql.sock文件.用servic ...

  2. centos7 无法启动网络(service network restart)错误解决办法

    centos7 无法启动网络(service network restart)错误解决办法: (以下方法均为网上COPY,同时感谢原博主分享) systemctl status network.ser ...

  3. centos7 无法启动网络(service network restart)错误解决办法(转)

    centos7 无法启动网络(service network restart)错误解决办法:(以下方法均为网上COPY,同时感谢原博主分享) systemctl status network.serv ...

  4. mysql进阶(十七)Cannot Connect to Database Server

    Cannot Connect to Database Server 缘由 由于不同的项目中使用的数据库用户名与密码出现了不一致的情况,在其中之前较早一个项目执行过程中出现"The user  ...

  5. mysql 启动停止脚本 and mysql 迁移 导入和导出

    ####监控脚本 [root@pdb~]# more /opt/VRTS/scripts/mysql_monitor.sh#!/bin/shn=`ps -ef |grep mysql|grep &qu ...

  6. Jmeter连接Mysql出现Cannot create PoolableConnectionFactory (Could not create connection to database server.)错误

    0 环境 系统环境:win10 1 正文 一般是数据库的驱动包版本不匹配(我是直接放在jmeter/lib下的) 当然有时候需要添加?useUnicode=true&characterEnco ...

  7. CentOS7下 Java、Tomcat、MySQL、Maven热部署

    本文介绍了CentOS7 64位下Java.Tomcat.MySQL.Maven热部署等服务器环境的搭建和调试过程. 学生服务器资源获取方法: 云+校园计划 - 腾讯云 阿里云云翼计划 github ...

  8. mysql -> 启动&多实例_03

    常用的连接方式: 套接字: mysql -uroot -p123 -S /application/mysql/tmp/mysql.sock Tcp/Ip: mysql -uroot -p123 -h ...

  9. 移走mysql data目录,及常见mysql启动问题

    一般mysql安装在/usr/local/下,现以将/usr/local/mysql/data目录移动到/home/mysql下为例 首先保证/home/mysql目录是存在的,本例中使用了mysql ...

随机推荐

  1. Install RabbitMQ on CentOS 7

    NOTE: this article is only for CentOS 7 How to Install RabbitMQ on CentOS 7 yum update Install erlan ...

  2. 【Java 基础 实验-抽象类应用的练习】(抽象类Employee被SalariedEmployee和HourEmployee继承 , 遍历,Scanner 输出)

    笔记总结: 1.Employee为抽象类,两个子类进行继承, public abstract double earning();两个子类分别实现 2.Employee[] emps[i].toStri ...

  3. 显示名为“xxx.XmlSerializers”的程序集未能加载到 ID 为 1 的 AppDomain 的“LoadFrom”绑定上下文中。

    VS调试程序运行中提示“显示名为“xxx.XmlSerializers”的程序集未能加载到 ID 为 1 的 AppDomain 的“LoadFrom”绑定上下文中.错误的原因为: System.IO ...

  4. 【转】Golang关于channel传递引用引发的坑

    原文: https://studygolang.com/articles/12310/comment/17923 ------------------------------------------- ...

  5. JDK源码那些事儿之红黑树基础上篇

    说到HashMap,就一定要说到红黑树,红黑树作为一种自平衡二叉查找树,是一种用途较广的数据结构,在jdk1.8中使用红黑树提升HashMap的性能,今天就来说一说红黑树. 前言 限于篇幅,本文只对红 ...

  6. WCF Windows基础通信

    概述 WCF,Windows Communication Foundation ,Windows通信基础, 面向服务的架构,Service Orientation Architechture=SOP ...

  7. nsight system

    https://developer.nvidia.com/nsight-systems pc nv家 看时序的工具 链接里面有分许数据的教学视频 dx12的多线程渲染 卡在vsync上

  8. Python中的if和while

    if 判断 if形式有三种: 1.if ... 2.if ... else ... 3.if ... elif ... else ... 实例: inp = raw_input('>>&g ...

  9. jaxb生成cdata块

    1.需要添加一个适配器: import javax.xml.bind.annotation.adapters.XmlAdapter; public class AdapterCDATA extends ...

  10. 1、python--第一天练习题

    #1.使用while循环输入 1 2 3 4 5 6 8 9 10 k = 0 while k < 10: k += 1 if k == 7: continue print(k) #2.求1-1 ...