日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) >

无法启动mysqll1006_CentOS7下MySQL服务启动失败原因及解决方法

發(fā)布時(shí)間:2025/3/8 43 豆豆
生活随笔 收集整理的這篇文章主要介紹了 无法启动mysqll1006_CentOS7下MySQL服务启动失败原因及解决方法 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

在重啟阿里的CentOS7服務(wù)器后,重啟MySQL 出現(xiàn)錯(cuò)誤

Starting mysqld (via systemctl):

Job for mysqld.service failed because the control process exited with error code.

See "systemctl status mysqld.service" and "journalctl -xe" fordetails.

[FAILED]

按照提示查看錯(cuò)誤信息

[root@djaljdw ~]# systemctl status mysqld.service

● mysqld.service -SYSV: MySQL database server.

Loaded: loaded (/etc/rc.d/init.d/mysqld; bad; vendor preset: disabled)

Active: failed (Result: exit-code) since Thu 2019-08-22 14:42:39CST; 1min 25s ago

Docs: man:systemd-sysv-generator(8)

Process:2427 ExecStart=/etc/rc.d/init.d/mysqld start (code=exited, status=1/FAILURE)

Aug22 14:42:37 izw91diu854rguz systemd[1]: Starting SYSV: MySQL database server....

Aug22 14:42:39 izw91diu854rguz mysqld[2427]: MySQL Daemon failed to start.

Aug22 14:42:39 izw91diu854rguz mysqld[2427]: Starting mysqld: [FAILED]

Aug22 14:42:39 izw91diu854rguz systemd[1]: mysqld.service: control process exited, code=exited status=1Aug22 14:42:39 izw91diu854rguz systemd[1]: Failed to start SYSV: MySQL database server..

Aug22 14:42:39 izw91diu854rguz systemd[1]: Unit mysqld.service entered failed state.

Aug22 14:42:39 izw91diu854rguz systemd[1]: mysqld.service failed.

Hint: Some lines were ellipsized, use-l to show in full.

[root@djaljdw ~]#??journalctl -xe

--

-- Unit session-2.scope has begun starting up.

Jan20 18:26:48 spark01 sshd[2916]: pam_unix(sshd:session): session opened for user spark by (uid=0)

Jan20 18:26:52 spark01 su[2944]: (to root) spark on pts/1Jan20 18:26:52 spark01 su[2944]: pam_unix(su-l:session): session opened for user root by spark(uid=1000)

Jan20 18:26:56 spark01 polkitd[909]: Registered Authentication Agent for unix-process:2974:117137(system bus name :1.25Jan20 18:26:56 spark01 systemd[1]: Starting SYSV: MySQL database 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.

Jan20 18:26:57 spark01 mysqld[2979]: MySQL Daemon failed to start.

Jan20 18:26:57 spark01 mysqld[2979]: Starting mysqld: [FAILED]

Jan20 18:26:57 spark01 systemd[1]: mysqld.service: control process exited, code=exited status=1Jan20 18:26:57 spark01 systemd[1]: Failed to start SYSV: MySQL database 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 isfailed.

Jan20 18:26:57 spark01 systemd[1]: Unit mysqld.service entered failed state.

Jan20 18:26:57 spark01 systemd[1]: mysqld.service failed.

Jan20 18:26:57 spark01 polkitd[909]: Unregistered Authentication Agent for unix-process:2974:117137(system bus name :1.

發(fā)現(xiàn)里面并沒(méi)有提供有用的錯(cuò)誤信息

所以去查看mysql日志信息(/var/log/mysqld.log)

190822 14:44:42 [Note] Plugin 'FEDERATED' isdisabled.190822 14:44:42 InnoDB: The InnoDB memory heap isdisabled190822 14:44:42InnoDB: Mutexes and rw_locks use GCC atomic builtins190822 14:44:42 InnoDB: Compressed tables use zlib 1.2.3

190822 14:44:42InnoDB: Using Linux native AIO190822 14:44:42 InnoDB: Initializing buffer pool, size = 128.0M

190822 14:44:42InnoDB: Completed initialization of buffer pool190822 14:44:42 InnoDB: highest supported file format isBarracuda.

InnoDB: The log sequence numberinibdata files does not match

InnoDB: the log sequence numberin the ib_logfiles!

190822 14:44:42 InnoDB: Database was not shut down normally!InnoDB: Starting crash recovery.

InnoDB: Reading tablespace informationfromthe .ibd files...

InnoDB: Restoring possible half-written data pages fromthe doublewrite

InnoDB: buffer...190822 14:44:42 InnoDB: Waiting forthe background threads to start190822 14:44:43 InnoDB: 5.5.59 started; log sequence number 1940403

190822 14:44:43 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306

190822 14:44:43 [Note] - '0.0.0.0' resolves to '0.0.0.0';190822 14:44:43 [Note] Server socket created on IP: '0.0.0.0'.190822 14:44:43 [ERROR] /usr/libexec/mysqld: Can't create/write to file'/var/run/mysqld/mysqld.pid'(Errcode: 2)

190822 14:44:43 [ERROR] Can't start server: can't create PID file: No such file or directory

問(wèn)題找到了:不能創(chuàng)建PID文件:沒(méi)有這樣的文件或目錄

于是去查看,果然沒(méi)有文件夾

[root@djaljdw ~]#? cd /var/run

[root@djaljdw ~]#??mkdir mysqld

[root@djaljdw ~]#??cd?mysqld

[root@djaljdw ~]#??touch mysqld.pid

重啟服務(wù)還是報(bào)錯(cuò)

于是又查看日志

190822 14:56:51 [Note] Plugin 'FEDERATED' isdisabled.190822 14:56:51 InnoDB: The InnoDB memory heap isdisabled190822 14:56:51InnoDB: Mutexes and rw_locks use GCC atomic builtins190822 14:56:51 InnoDB: Compressed tables use zlib 1.2.3

190822 14:56:51InnoDB: Using Linux native AIO190822 14:56:51 InnoDB: Initializing buffer pool, size = 128.0M

190822 14:56:51InnoDB: Completed initialization of buffer pool190822 14:56:51 InnoDB: highest supported file format isBarracuda.

InnoDB: The log sequence numberinibdata files does not match

InnoDB: the log sequence numberin the ib_logfiles!

190822 14:56:51 InnoDB: Database was not shut down normally!InnoDB: Starting crash recovery.

InnoDB: Reading tablespace informationfromthe .ibd files...

InnoDB: Restoring possible half-written data pages fromthe doublewrite

InnoDB: buffer...190822 14:56:51 InnoDB: Waiting forthe background threads to start190822 14:56:52 InnoDB: 5.5.59 started; log sequence number 1940403

190822 14:56:52 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306

190822 14:56:52 [Note] - '0.0.0.0' resolves to '0.0.0.0';190822 14:56:52 [Note] Server socket created on IP: '0.0.0.0'.190822 14:56:52 [ERROR] /usr/libexec/mysqld: Can't create/write to file'/var/run/mysqld/mysqld.pid'(Errcode: 13)

190822 14:56:52 [ERROR] Can't start server: can't create PID file: Permission denied

發(fā)現(xiàn):無(wú)法創(chuàng)建PID文件:權(quán)限被拒絕

解決辦法:

修改 /var/run/mysqld/權(quán)限為mysql

[root@djaljdw ~]#? chown -R mysql /var/run/mysqld

[root@djaljdw ~]#? chgrp -R mysql /var/run/mysqld

[root@djaljdw ~]#? chmod 777 /var/run/mysqld

重啟服務(wù)完美解決

tip:看日志是解決問(wèn)題的一個(gè)很好的辦法!

總結(jié)

以上是生活随笔為你收集整理的无法启动mysqll1006_CentOS7下MySQL服务启动失败原因及解决方法的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。