记一次mysql 重启失败
Posted 费墨
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了记一次mysql 重启失败相关的知识,希望对你有一定的参考价值。
今天重启mysql发现报错如下:
$ sudo service mysqld restart
Redirecting to /bin/systemctl restart mysqld.service
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details
解决思路:查看mysql error log
vim /etc/my.cnf
日志文件位置如下:
log-error=/var/log/mysqld.log
less /var/log/mysqld.log
发现如下报错信息
mysqld: File ‘/var/log/mysql/mysql-bin.index‘ not found (OS errno 13 - Permission denied)
2020-05-28T07:43:55.744384Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.20) starting as process 17788
2020-05-28T07:43:55.747675Z 0 [ERROR] [MY-010119] [Server] Aborting
发现是没有权限执行导致的重启失败。添加权限,问题解决
sudo chmod -R 777 /var/log/mysql/*
以上是关于记一次mysql 重启失败的主要内容,如果未能解决你的问题,请参考以下文章
记一次Mysql故障排查(lock wait timeout exceeded;try restarting transaction)