3

MySQL server was running fine last night, but this morning, when I tried to hit the Bugzilla server, I found it down. I tried to start it, but I get:

Job for mysql.service failed because the control process exited with 
error code. See "systemctl status mysql.service" and "journalctl -xe" for 
details.

I have done a few google searches and found a bunch of questions. I tried some of the answers, but the server is still down. I have plenty of space,

root@GBRTEF01LX005:/home/bzadmin# df -h
Filesystem                                  Size  Used Avail Use% Mounted on
udev                                        2.0G     0  2.0G   0% /dev
tmpfs                                       396M  5.8M  390M   2% /run
/dev/mapper/CMS--UBN--TEMPLATE--1--vg-root   75G  4.8G   66G   7% /
tmpfs                                       2.0G     0  2.0G   0% /dev/shm
tmpfs                                       5.0M     0  5.0M   0% /run/lock
tmpfs                                       2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/sda1                                   472M  106M  342M  24% /boot
tmpfs                                       396M     0  396M   0% /run/user/1001

I have also added more swap space for InnoDB,

innodb_buffer_pool_size = 20M

which is one of the suggestion I found, and lastly, here is the last 30 lines of journalctl -xe,

root@GBRTEF01LX005:/home/bzadmin# journalctl -xe | tail -30
Feb 25 16:26:23 GBRTEF01LX005 systemd[1]: Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has failed.
--
-- The result is failed.
Feb 25 16:26:23 GBRTEF01LX005 systemd[1]: mysql.service: Unit entered failed state.
Feb 25 16:26:23 GBRTEF01LX005 systemd[1]: mysql.service: Failed with result 'exit-code'.
Feb 25 16:26:23 GBRTEF01LX005 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Feb 25 16:26:23 GBRTEF01LX005 systemd[1]: Stopped MySQL Community Server.
-- Subject: Unit mysql.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has finished shutting down.
Feb 25 16:26:23 GBRTEF01LX005 systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has begun starting up.
Feb 25 16:26:23 GBRTEF01LX005 audit[11846]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/11846/status" pid=11846 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=107 ouid=107
Feb 25 16:26:23 GBRTEF01LX005 audit[11846]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=11846 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=107 ouid=0
Feb 25 16:26:23 GBRTEF01LX005 audit[11846]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/11846/status" pid=11846 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=107 ouid=107
Feb 25 16:26:23 GBRTEF01LX005 kernel: audit: type=1400 audit(1519575983.239:317): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/11846/status" pid=11846 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=107 ouid=107
Feb 25 16:26:23 GBRTEF01LX005 kernel: audit: type=1400 audit(1519575983.239:318): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=11846 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=107 ouid=0
Feb 25 16:26:23 GBRTEF01LX005 kernel: audit: type=1400 audit(1519575983.239:319): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/11846/status" pid=11846 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=107 ouid=107
Feb 25 16:26:25 GBRTEF01LX005 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE

Any help would be greatly appreciated! thanks.

josé

jicman
  • 81
  • Can this be caused by apparmor? I see all of these entries audit[11846]: AVC apparmor="DENIED" and kernel: audit: type=1400 audit(1519575983.239:318): apparmor="DENIED" – jicman Feb 25 '18 at 22:49
  • Be sure to have a look at the logs of MySQL itself as well, could be something like /var/log/mysql/error.log. Those DENIED might not be the problem at all. https://askubuntu.com/questions/916009/mysql-wont-start-because-of-apparmor#comment1619398_916009 – Thorsten Schöning Feb 26 '18 at 07:50
  • Yes, I looked at those from the beginning. I ended up disabling apparmor, and reinstalling MySQL, re-importing the database, and it has been running for a while. The reason why I did this was because of a bunch of links I found, specially these two: 1 and 2. I'll keep it like this, for now, to see if I don't have the same problem again. – jicman Feb 26 '18 at 14:00

1 Answers1

0

I encountered this error on Armbian 20.08.5 Bionic with Linux 5.4.65.

The problem was a missing log directory at /var/log/mysql, indicated by a log entry in /var/log/syslog. Creating the directory /var/log/mysql with owner mysql and group adm fixed it for me.

mkdir /var/log/mysql
chown mysql:adm /var/log/mysql

start mysql with your init system (e.g. systemctl start mysql)

DBX12
  • 103