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

前段时间安装好的myql数据库,一直用的挺好的,结果昨天重启了一下服务器后mysql莫名的启动不了了,状况如下:

   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  ]





[root@iZbp1aa7j53hmxfz1ph8tdZ mysql]# journalctl -xe -u mysqld.service --since "2 minutes ago" Aug 28 16:29:10 iZbp1aa7j53hmxfz1ph8tdZ systemd[1]: mysqld.service failed. Aug 28 16:29:10 iZbp1aa7j53hmxfz1ph8tdZ systemd[1]: mysqld.service holdoff time over, scheduling restart. Aug 28 16:29:10 iZbp1aa7j53hmxfz1ph8tdZ systemd[1]: Stopped MySQL Server. -- Subject: Unit mysqld.service has finished shutting down -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit mysqld.service has finished shutting down. Aug 28 16:29:10 iZbp1aa7j53hmxfz1ph8tdZ 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 28 16:29:10 iZbp1aa7j53hmxfz1ph8tdZ mysqld_pre_systemd[21813]: /usr/sbin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such f Aug 28 16:29:10 iZbp1aa7j53hmxfz1ph8tdZ systemd[1]: mysqld.service: control process exited, code=exited status=127 Aug 28 16:29:10 iZbp1aa7j53hmxfz1ph8tdZ 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 28 16:29:10 iZbp1aa7j53hmxfz1ph8tdZ systemd[1]: Unit mysqld.service entered failed state. Aug 28 16:29:10 iZbp1aa7j53hmxfz1ph8tdZ systemd[1]: mysqld.service failed. Aug 28 16:29:10 iZbp1aa7j53hmxfz1ph8tdZ systemd[1]: mysqld.service holdoff time over, scheduling restart. Aug 28 16:29:10 iZbp1aa7j53hmxfz1ph8tdZ systemd[1]: Stopped MySQL Server. -- Subject: Unit mysqld.service has finished shutting down -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit mysqld.service has finished shutting down. Aug 28 16:29:10 iZbp1aa7j53hmxfz1ph8tdZ systemd[1]: start request repeated too quickly for mysqld.service Aug 28 16:29:10 iZbp1aa7j53hmxfz1ph8tdZ 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 28 16:29:10 iZbp1aa7j53hmxfz1ph8tdZ systemd[1]: Unit mysqld.service entered failed state. Aug 28 16:29:10 iZbp1aa7j53hmxfz1ph8tdZ systemd[1]: mysqld.service failed. lines 187-230/230 (END)
最新发布
08-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值