MySQL db refusing to start after Ubuntu 16.04.1 reboot
-
I have mysql recently installed on an Ubuntu 16.04.1 server and have been testing the application for the last couple of days without issue. I updated Ubuntu (mysql didn't require any updates - it is a recent install so it's already current) and after the update and a reboot, mysql refuses to start. I'm new to mysql so I'm hoping someone here can help me figure out why it isn't starting up.
service mysql status output:
● mysql.service - MySQL Community Server` Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Active: activating (start-post) (Result: exit-code) since Sat 2017-02-11 11:54:54 EST; 27s ago Process: 3129 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE) Process: 3126 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS) Main PID: 3129 (code=exited, status=1/FAILURE); : 3135 (mysql-systemd-s) Tasks: 2 Memory: 332.0K CPU: 519ms CGroup: /system.slice/mysql.service └─control ├─3135 /bin/bash /usr/share/mysql/mysql-systemd-start post └─3723 sleep 1 Feb 11 11:54:54 REDACTED systemd[1]: mysql.service: Service hold-off time over, scheduling restart. Feb 11 11:54:54 REDACTED systemd[1]: Stopped MySQL Community Server. Feb 11 11:54:54 REDACTED systemd[1]: Starting MySQL Community Server... Feb 11 11:54:58 REDACTED systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
Looking at journalctl -xe reveals:
-- The result is failed. Feb 11 12:05:04 REDACTED systemd[1]: mysql.service: Unit entered failed state. Feb 11 12:05:04 REDACTED systemd[1]: mysql.service: Failed with result 'exit-code'. Feb 11 12:05:04 REDACTED systemd[1]: mysql.service: Service hold-off time over, scheduling restart. Feb 11 12:05:04 REDACTED kernel: audit: type=1400 audit(1486832704.624:84): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/6321/status" pid=6321 comm="mysqld" requested_mask="r" d Feb 11 12:05:04 REDACTED kernel: audit: type=1400 audit(1486832704.624:85): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=6321 comm="mysqld" requested_ma Feb 11 12:05:04 REDACTED kernel: audit: type=1400 audit(1486832704.624:86): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/6321/status" pid=6321 comm="mysqld" requested_mask="r" d Feb 11 12:05:04 REDACTED audit[6321]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/6321/status" pid=6321 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=117 ouid=117 Feb 11 12:05:04 REDACTED audit[6321]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=6321 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=117 o Feb 11 12:05:04 REDACTED audit[6321]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/6321/status" pid=6321 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=117 ouid=117 Feb 11 12:05:04 REDACTED 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 11 12:05:04 REDACTED 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 11 12:05:06 REDACTED systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
Can't figure out why it's is being denied startup by apparmor. Any ideas on where to go next to get this thing started?
-
What does
journalctl -xe
have to say? -
@DustinB3403 said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:
What does
journalctl -xe
have to say?I've posted that output in my original post. It's at the bottom of the post.
-
@DustinB3403 It basically shows apparmor is denying mysql startup.
-
@NashBrydges How is this mySQL system being run, with sudo?
-
@DustinB3403 Correct. To start I used "sudo service mysql status" and this is where I discovered it wasn't running.
-
It looks to me like a dependency was removed when you upgraded.
Process: 3129 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
-
I thought that Ubuntu came with MariaDB, not MySQL. Where did you get MySQL?
-
@DustinB3403 said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:
/usr/sbin/mysqld
Just checked. There is no file named "/usr/sbin/mysqld"
-
@scottalanmiller said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:
I thought that Ubuntu came with MariaDB, not MySQL. Where did you get MySQL?
Installed from "sudo apt-get install mysql-server"
-
@NashBrydges said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:
@DustinB3403 said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:
/usr/sbin/mysqld
Just checked. There is no file named "/usr/sbin/mysqld"
Did you create a user outside of root on this system? If so check under that user account.
-
@NashBrydges said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:
@scottalanmiller said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:
I thought that Ubuntu came with MariaDB, not MySQL. Where did you get MySQL?
Installed from "sudo apt-get install mysql-server"
Oh okay, maybe they didn't switch. I run my databases on CentOS so might have missed that they hung back on MySQL.
-
@NashBrydges said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:
@DustinB3403 said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:
/usr/sbin/mysqld
Just checked. There is no file named "/usr/sbin/mysqld"
The fact that you don't see the path means that either your running under the wrong account (don't have permission) or that something was removed.
-
@DustinB3403 I created a new user with select, update, insert delete privs on a new database within mysql but there nothing under any other users anywhere. I've been using this user for the past 2 days and it worked well.
I should mention that mysql is running on the standard port and nothing has been changed on the mysqld.cnf file.
-
Can you try this...
sudo apt-get install apparmor-profiles apparmor-profiles-extra apparmor-docs apparmor-utils
See if that does anything?
-
@DustinB3403 said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:
@NashBrydges said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:
@DustinB3403 said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:
/usr/sbin/mysqld
Just checked. There is no file named "/usr/sbin/mysqld"
The fact that you don't see the path means that either your running under the wrong account (don't have permission) or that something was removed.
The root account still existed in the mysql.user table, along with the debian maintenance account that is setup during install. I added a new underpriviledged user to the mysql.user table but not to the server. Thatis still running under the only account that exists.
-
@scottalanmiller said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:
Can you try this...
sudo apt-get install apparmor-profiles apparmor-profiles-extra apparmor-docs apparmor-utils
See if that does anything?
This did install additional packages but mysql service still isn't starting however this time the output of journalctl -xe shows:
-- 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 11 12:42:35 REDACTED systemd[1]: mysql.service: Unit entered failed state. Feb 11 12:42:35 REDACTED systemd[1]: mysql.service: Failed with result 'exit-code'. Feb 11 12:42:35 REDACTED systemd[1]: mysql.service: Service hold-off time over, scheduling restart. Feb 11 12:42:35 REDACTED 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 11 12:42:35 REDACTED 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 11 12:42:37 REDACTED systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
This seems even more cryptic than the first output.
-
Ok, I started looking into the error.log file to get more info about what was happening. I found that there was an error about not being able to load something but the log file was pretty large so I created a new log file to replace this one and went to restart mysql so I would have the one attempt's worth of records to review. To my surprise, after having provided a new error.log file, mysql started up no problem. Not sure wtf that was all about or why it failed with the current error.log contents.
I'm removing mysql and starting from scratch to see if I can replicate the issue.
-
That's a weird one!
-
@scottalanmiller Why the heck would a log file stop a service from loading?!