MySQL 每天在“启动 ACPI 事件守护程序”后停止

MySQL 每天在“启动 ACPI 事件守护程序”后停止
systemd[1]: Starting Daily apt upgrade and clean activities...
systemd[1]: Reloading.
systemd[1]: Started ACPI event daemon.
systemd[1]: Reloading.
systemd[1]: Started ACPI event daemon.
systemd[1]: Stopping MySQL 5.7.20 Community Server...
systemd[1]: Stopped MySQL 5.7.20 Community Server.
kernel: [420109.677234] audit: type=1400 audit(1512740048.434:73): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/mysqld" pid=15127 comm="apparmor_parser"
kernel: [420109.697629] audit: type=1400 audit(1512740048.454:74): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/15146/status" pid=15146 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
kernel: [420109.697657] audit: type=1400 audit(1512740048.454:75): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=15146 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
kernel: [420109.697692] audit: type=1400 audit(1512740048.454:76): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/15146/status" pid=15146 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
kernel: [420109.806977] audit: type=1400 audit(1512740048.562:77): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/mysqld" pid=15160 comm="apparmor_parser"

答案1

简而言之:这是 mysql-server-5.7 的自动更新,由于配置文件的新结构而失败。您可以通过尝试更新来手动检查它:

sudo apt-get install mysql-server-5.7

它将显示这样的错误消息:

Setting up mysql-server-5.7 (5.7.21-0ubuntu0.16.04.1) ...
update-alternatives: error: alternative path /etc/mysql/mysql.cnf doesn't exist
dpkg: error processing package mysql-server-5.7 (--configure):

解决方案

复制配置文件及其旧名称:

cp my.cnf.fallback mysql.cnf

答案2

对于到这里结束的每个人,但 /etc/mysql/FROZEN 未设置,并且 5.7 已经是最新版本,没有更新问题:

请稍早一点检查你的日志。它可能包含

systemd[1]: Starting Daily apt upgrade and clean activities...

如果你想摆脱它(见https://linoxide.com/ubuntu-how-to/enable-disable-unattended-upgrades-ubuntu-16-04/):

sudo apt-get remove unattended-upgrades
sudo systemctl stop apt-daily.timer
sudo systemctl disable apt-daily.timer
sudo systemctl disable apt-daily.service

请注意,此命令也可能导致 mysqld 和其他命令的重新启动。

sudo systemctl daemon-reload

相关内容