CentOS7下MySQL服务启动失败原因及解决方法
在重启阿里的CentOS7服务器后,重启MySQL 出现错误
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" for details.
[FAILED]
按照提示查看错误信息
[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 -- :: CST; 1min 25s ago
Docs: man:systemd-sysv-generator()
Process: ExecStart=/etc/rc.d/init.d/mysqld start (code=exited, status=/FAILURE) Aug :: izw91diu854rguz systemd[]: Starting SYSV: MySQL database server....
Aug :: izw91diu854rguz mysqld[]: MySQL Daemon failed to start.
Aug :: izw91diu854rguz mysqld[]: Starting mysqld: [FAILED]
Aug :: izw91diu854rguz systemd[]: mysqld.service: control process exited, code=exited status=
Aug :: izw91diu854rguz systemd[]: Failed to start SYSV: MySQL database server..
Aug :: izw91diu854rguz systemd[]: Unit mysqld.service entered failed state.
Aug :: izw91diu854rguz systemd[]: mysqld.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
[root@djaljdw ~]# journalctl -xe
--
-- Unit session-.scope has begun starting up.
Jan :: spark01 sshd[]: pam_unix(sshd:session): session opened for user spark by (uid=)
Jan :: spark01 su[]: (to root) spark on pts/
Jan :: spark01 su[]: pam_unix(su-l:session): session opened for user root by spark(uid=)
Jan :: spark01 polkitd[]: Registered Authentication Agent for unix-process::
(system bus name :1.25
Jan :: spark01 systemd[]: 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.
Jan :: spark01 mysqld[]: MySQL Daemon failed to start.
Jan :: spark01 mysqld[]: Starting mysqld: [FAILED]
Jan :: spark01 systemd[]: mysqld.service: control process exited, code=exited status=
Jan :: spark01 systemd[]: 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 is failed.
Jan :: spark01 systemd[]: Unit mysqld.service entered failed state.
Jan :: spark01 systemd[]: mysqld.service failed.
Jan :: spark01 polkitd[]: Unregistered Authentication Agent for unix-process::
(system bus name :.
发现里面并没有提供有用的错误信息
所以去查看mysql日志信息(/var/log/mysqld.log)
:: [Note] Plugin 'FEDERATED' is disabled.
:: InnoDB: The InnoDB memory heap is disabled
:: InnoDB: Mutexes and rw_locks use GCC atomic builtins
:: InnoDB: Compressed tables use zlib 1.2.
:: InnoDB: Using Linux native AIO
:: InnoDB: Initializing buffer pool, size = 128.0M
:: InnoDB: Completed initialization of buffer pool
:: InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
:: InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
:: InnoDB: Waiting for the background threads to start
:: InnoDB: 5.5. started; log sequence number
:: [Note] Server hostname (bind-address): '0.0.0.0'; port:
:: [Note] - '0.0.0.0' resolves to '0.0.0.0';
:: [Note] Server socket created on IP: '0.0.0.0'.
:: [ERROR] /usr/libexec/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2)
:: [ERROR] Can't start server: can't create PID file: No such file or directory
问题找到了:不能创建PID文件:没有这样的文件或目录
于是去查看,果然没有文件夹
:: [Note] Plugin 'FEDERATED' is disabled.
:: InnoDB: The InnoDB memory heap is disabled
:: InnoDB: Mutexes and rw_locks use GCC atomic builtins
:: InnoDB: Compressed tables use zlib 1.2.
:: InnoDB: Using Linux native AIO
:: InnoDB: Initializing buffer pool, size = 128.0M
:: InnoDB: Completed initialization of buffer pool
:: InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
:: InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
:: InnoDB: Waiting for the background threads to start
:: InnoDB: 5.5. started; log sequence number
:: [Note] Server hostname (bind-address): '0.0.0.0'; port:
:: [Note] - '0.0.0.0' resolves to '0.0.0.0';
:: [Note] Server socket created on IP: '0.0.0.0'.
:: [ERROR] /usr/libexec/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 13)
:: [ERROR] Can't start server: can't create PID file: Permission denied
发现:无法创建PID文件:权限被拒绝
重启服务完美解决
tip:看日志是解决问题的一个很好的办法!
CentOS7下MySQL服务启动失败原因及解决方法的更多相关文章
- CentOS 7下MySQL服务启动失败的解决思路
今天,启动MySQL服务器失败,如下所示: [root@spark01 ~]# /etc/init.d/mysqld start Starting mysqld (via systemctl): Jo ...
- CentOS下,mysql服务启动失败
mysql服务启动失败,可以使用排除法查找原因: 如果修改了my.cnf后重启mysql服务失败,大多数情况下都是配置文件有错误, 可以通过备份原来的配置文件,然后将配置文件清空,只剩下[mysqld ...
- 玩转Windows服务系列——无COM接口Windows服务启动失败原因及解决方案
将VS创建的Windows服务项目编译生成的程序,通过命令行 “服务.exe -Service”注册为Windows服务后,就可以通过服务管理器进行管理了. 问题 通过服务管理器进行启动的时候,发现服 ...
- phpStudy启动失败时的解决方法
phpStudy启动失败时的解决方法 phpStudy启动失败,原因一是防火墙拦截,二是80端口已经被别的程序占用,如IIS,迅雷等:三是没有安装VC9运行库,php和apache都是VC9编译.解决 ...
- 破解windows下MySQL服务启动不了的情况下不能对其进行全然卸载的解决方式
下面的文章主要介绍的是在MySQL服务启动不了的情况下,不能对其进行全然卸载的实际解决的方法的描写叙述,下面就是对解决MySQL服务启动不了的情况下详细方案的描写叙述,希望在你今后的学习中会对你有所帮 ...
- windows无法启动MySQL服务报错1067的解决方法是怎样?
方法一: 1.打开my.ini文件,找到default-storage-engine=InnoDB这一行,把它改成default-storage-engine=MyISAM.2.删除在MySQL安装目 ...
- tomcat下服务启动失败原因
Tomcat启动成功,输入网址后可以显示小黄猫界面,但是在Tomcat下的服务却启动不成功,显示404(以Jenkins为例,运用多种方式查看原因) 注:1.单启动Tomcat服务是可以启动成功的. ...
- mysql 服务启动失败
mysql 数据库连接失败 1.用naviCat Preiumn 连接本地的mysql 失败,查找原因,mysql 数据库服务没有启用,但是在服务列表里面没有找到对应的mysql 服务. 所以在cmd ...
- 因为曾经装过Mysql导致再次装时windows无法启动MySQL服务报错1067的解决方法
找到这里 MySQL右击属性 检查这里的可执行文件的路径是否正确,因为我这里显示的是原先的文件夹所以会一直启动失败,修改一下 这里你去百度经验 windows服务修改可执行文件路径 网址https:/ ...
随机推荐
- 最近公共祖先LCA(Tarjan算法)的思考和算法实现——转载自Vendetta Blogs
LCA 最近公共祖先 Tarjan(离线)算法的基本思路及其算法实现 小广告:METO CODE 安溪一中信息学在线评测系统(OJ) //由于这是第一篇博客..有点瑕疵...比如我把false写成了f ...
- 26.Python三目运算符(三元运算符)用法详解
Python 可通过 if 语句来实现三目运算符的功能,因此可以近似地把这种 if 语句当成三目运算符.作为三目运算符的 if 语句的语法格式如下: True_statements if expres ...
- 记一次protobuf和hbase自带protobuf版本冲突的解决
使用protobuf生产模板代码,使用的版本是: <dependency> <groupId>com.google.protobuf</groupId> <a ...
- 面试准备一个访问一个URL的过程简版
客户端获取URL - > DNS解析 - > TCP连接 - >发送HTTP请求 - >服务器处理请求 - >返回报文 - >浏览器解析渲染页面 - > TC ...
- SRS之SrsRtmpServer::connect_app详解
1. connect('live') 2. SrsRtmpServer::connect_app 位于 srs_rtmp_stack.cpp.在 SRS 的 RTMP 连接处理线程 conn 中,当与 ...
- Win10删除文件显示删除确认对话框
1.右键单击“回收站”图标:2.在弹出属性窗口中,点击“属性”选项:3.在“回收站”窗口中,在选项“显示删除确认对话框”前面打钩,并单击“确定”按钮:
- mysql从zip包安装小记
@echo offtitle mysql zip安装set PATH="%CD%\bin";%PATH%if not exist .\data mkdir datarem mysq ...
- 如何实现Eclipse默认编码为UTF-8
1 Window->Preferences->General->Workspace,右边Text file encoding选择Other->UTF-8 2 Window-&g ...
- linux之文件操作和权限
文件查看 cat显示文本 cat [option] ... [file] ... cat -E a.txt # 显示$符号 cat -n a.txt # 对显示的每一行加行号 cat -b a.txt ...
- 监控系统-PMM
Percona Monitoring and Management (PMM)是一款开源的用于管理和监控MySQL和MongoDB性能的开源平台 通过PMM客户端收集到的DB监控数据用第三方软件Gra ...