centos7 mysql 启动mysqld.service - SYSV: MySQL database server错误

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

原文地址:https://www.cnblogs.com/zhoading/p/11491398.html

时间: 2024-09-29 15:58:33

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

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

centos7 无法启动网络(service network restart)错误解决办法:(以下方法均为网上COPY,同时感谢原博主分享) systemctl status network.service 出现以下错误"rtnetlink answers file exists" 的解决方法 第一种: 和 NetworkManager 服务有冲突,这个好解决,直接关闭 NetworkManger 服务就好了, service NetworkManager stop,并且禁止开机启动

centos7 systemd加入mysqld.service

说明: 前面的数据库文章中提到数据库初始化主主所以这里就直接接着上文写了 写一个mysql.service vim mysql.service [Unit] Description=MySQL Server Documentation=man:mysqld(5.7) After=network.target After=syslog.target Before=shutdown.target # 关机前操作 [Install] WantedBy=multi-user.target Alias=m

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

systemctl status network.service 出现以下错误“rtnetlink answers file exists” 的解决方法 和 NetworkManager 服务有冲突,这个好解决,直接关闭 NetworkManger 服务就好了.service NetworkManager stop,再重新输入service network restart就好了.

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

0 环境 系统环境:win10 1 正文 一般是数据库的驱动包版本不匹配(我是直接放在jmeter/lib下的) 当然有时候需要添加?useUnicode=true&characterEncoding=utf8 查看一下你的数据时区的设置 有时因为它报错 https://www.lanzous.com/i823l3c 原文地址:https://www.cnblogs.com/my-ordinary/p/12050014.html

centos7下启动不了mysql或者mariadb报错

centos7 系统中编译安装mysql或者mariab启动不了服务 报错 错误如下:Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details. 解决方法: 根据提示,分别使用systemctl status mysqld

mysql启动分析

1.mysql启动配置文件加载路径 /etc/my.cnf/ /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf 2.mysql启动方式 service mysqld start /etc/init.d/mysqld start 说明mysqld来自 cp /usr/local/mysql/support-file/mysql.server  /etc/init.d/mysqld 以下3种方式,可用启动多实例 /usr/local/my

MySQL启动与多实例安装

启动方式及故障排查 一.几个问题 1.1 /etc/init.d/mysql 从哪来 cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql 1.2 mysql能否设置成开机启动 可以,但是没必要 # 方法1: chkconfig mysql on # 方法2: echo "/etc/init.d/mysql start" >> /etc/rc.local 1.3 开机启动? 有没有必要把MySQL设

centos7彻底卸载mysql和通过yum安装mysql

彻底卸载mysql 查看是否有安装的mysql rpm -qa | grep -i mysql // 查看命令1 1 这里写图片描述 yum list install mysql* // 查看命令2 1 这里写图片描述 卸载mysql安装包 yum remove mysql mysql-server mysql-libs compat-mysql51yum remove mysql-community-releaserpm -e --nodeps mysql-community-libs-5.7

MySql启动报错,无法更新PID文件

MySql启动报错 Starting MySQL.. ERROR! The server quit without updating PID file (/var/lib/mysql..) 1,查看错误日志 2017-08-10 19:38:14 31865 [Note] InnoDB: Initializing buffer pool, size = 50.0M InnoDB: mmap(53657600 bytes) failed; errno 12 2017-08-10 19:38:14