我们有两个Ubuntu实例,它们都有MySQL服务器。几乎没有任何明显的原因,MySQL每天都会被关闭。Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-1031-aws x86_64)
在MySQL被停止的实例中,我唯一能找到的是AppArmor。最初,我认为它不应该给MySQL带来任何问题。但为了安全起见,我试着删除那个装置。
以下是应用程序装甲删除的日志
ubuntu@ip-XX-XXX-XX-XX:~$ sudo apt remove apparmor
sudo: unable to resolve host ip-XX-XXX-XX-XX: Resource temporarily unavailable
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-aws-headers-4.15.0-1021 linux-aws-headers-4.15.0-1023 linux-aws-headers-4.15.0-1027 linux-aws-headers-4.15.0-1029 linux-aws-headers-4.15.0-1032
linux-aws-headers-4.15.0-1033
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
apparmor snapd ubuntu-core-launcher
0 upgraded, 0 newly installed, 3 to remove and 139 not upgraded.
1 not fully installed or removed.
After this operation, 69.6 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 222315 files and directories currently installed.)
Removing ubuntu-core-launcher (2.37.4+18.04.1) ...
Removing snapd (2.37.4+18.04.1) ...
Removing apparmor (2.12-4ubuntu5.1) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for man-db (2.8.3-2) ...
Setting up mysql-server-5.7 (5.7.25-0ubuntu0.18.04.2) ...
update-alternatives: warning: forcing reinstallation of alternative /etc/mysql/mysql.cnf because link group my.cnf is broken
update-alternatives: warning: not replacing /etc/mysql/my.cnf with a link
Checking if update is needed.
Checking server version.
Running queries to upgrade MySQL server.
mysql_upgrade: [ERROR] 1146: Table 'mysql.plugin' doesn't exist
mysql_upgrade failed with exit status 5
dpkg: error processing package mysql-server-5.7 (--configure):
installed mysql-server-5.7 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
mysql-server-5.7
E: Sub-process /usr/bin/dpkg returned an error code (1)为什么AppArmor试图升级MySQL,即使在卸载时也是如此?
这会是MySQL关闭的原因吗?(世界协调时间早上6:30 )
编辑这答案可能有助于它的外观。但是问题仍然存在,为什么apparmor在卸载时也需要更新mysql?如果我将变量从
default-character-set = utf8到character_set_server = utf8
我可能会工作,但这是否意味着应用程序装甲将自动更新/升级mysql?
有一个类似的问题,但它没有多少细节,也没有答案。没有尝试删除应用程序装甲,所以我把问题分开。
发布于 2019-05-05 06:21:21
首先运行sudo apt自动删除并看到它将帮助我看到另一个问题: sudo:无法解决主机ip-XX-XXX-XX:资源暂时不可用,请尝试修复这些资源并重试。我认为一些陈旧的配置或资源迫使mysql进行更改,如果是生产,请小心,并在接受更改之前检查正在删除的内容。
https://serverfault.com/questions/965843
复制相似问题