一、查询mysql无法启动问题:
service mysql start 启动mysql
报错:
Job for mysqld.service failed because the control process exited with error code.
See "systemctl status mysqld.service" and "journalctl -xe" for details.
我们可用用他给出的提示查看问题,但是最终实际效果是并未正确的定位到报错问题可用尝试下面给出的解决方案。
1、打开配置文件 添加log输出
##查看配置文件 看看是否配置 log-error 日志参数
cat /etc/my.cnf
##如果没用 打开配置文件 添加参数 如 log-error = /www/server/data/my_errror.log
vim /etc/my.cnf
2、重启数据库,查看log报错看不懂就翻译一下
2019-08-02T02:43:06.225931Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2019-08-02T02:43:06.225958Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2019-08-02T02:43:06.226002Z 0 [Note] /www/server/mysql/bin/mysqld (mysqld 5.7.24) starting as process 15083 ...
2019-08-02T02:43:06.258458Z 0 [Note] InnoDB: PUNCH HOLE support available
2019-08-02T02:43:06.258509Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-08-02T02:43:06.258513Z 0 [Note] InnoDB: Uses event mutexes
2019-08-02T02:43:06.258517Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-08-02T02:43:06.258520Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-08-02T02:43:06.258810Z 0 [Note] InnoDB: Number of pools: 1
2019-08-02T02:43:06.258922Z 0 [Note] InnoDB: Using CPU crc32 instructions
mysqld: Can't create/write to file '/tmp/ib2RxhiG' (Errcode: 28 - No space left on device)
2019-08-02T02:43:06.260999Z 0 [ERROR] InnoDB: Unable to create temporary file; errno: 28
2019-08-02T02:43:06.261006Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2019-08-02T02:43:06.261011Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-08-02T02:43:06.261014Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-08-02T02:43:06.261017Z 0 [ERROR] Failed to initialize builtin plugins.
2019-08-02T02:43:06.261020Z 0 [ERROR] Aborting
2019-08-02T02:43:06.261029Z 0 [Note] Binlog end
2019-08-02T02:43:06.261066Z 0 [Note] Shutting down plugin 'CSV'
2019-08-02T02:43:06.263332Z 0 [Note] /www/server/mysql/bin/mysqld: Shutdown complete
3、从日志中找到关键点,报错信息很明显
mysqld: Can't create/write to file '/tmp/ib2RxhiG' (Errcode: 28 - No space left on device)
翻译是:mysqld:无法创建/写入文件'/tmp/ib2RxhiG'(错误代码:28 -设备上没有剩余空间)
4、df -h查看空间,好像没什么问题
5、df -i 查看inode,果然有问题满满的100%
好了这里问题的原因就找到了,是因为无法创建inode,下面来解决一下
查看下一篇文章:https://blog.csdn.net/qq_24909089/article/details/98194424