问题:1月31号,2月1号MySQL无故自动关闭
排查思路:先看MySQL的错误日志,查看有没有可疑的操作问题,看到系统发出的关闭状态,其他用户没关闭操作命令
tail -1000 /var/log/mysql/error.log.1
看到有系统发出关闭的状态
然后看看系统日志dmesg,也没有系统压力导致的kill mysql操作
最后查看/var/log/syslog,发现了以下日志
发现了是Ubuntu的系统组件自动更新导致的
解决方法:
apt-get remove unattended-upgrades
systemctl stop apt-daily.timer
systemctl disable apt-daily.timer
systemctl stop apt-daily.service
systemctl daemon-reload