Score:0

Ubuntu can't start/configure mysql-server after upgrading ubuntu from 18.04 to 20.04

gh flag

I've got a problem with Ubuntu that I can't resolve. I was upgrading my Ubuntu from 18.04 to 20.04 and during the installation process and error occured:

apparmor parser error for /etc/apparmor.d/usr.sbin.mysqld in /etc/apparmor.d/usr.sbin.mysqld at line 9: Could not open 'abstractions/mysql'

After that the installation freezed. I canceled it, restarted my computer and finished installation of the new version of ubuntu. Everything seemed working except mysql. I've tried to reinstall it multiple times and nothing worked. The installation of mysql ends up with success, but it's freezes up when trying to start the service. This is the last message I get:

mysqld is running as pid 20051

This is service status:

mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Drop-In: /etc/systemd/system/mysql.service.d └─override.conf Active: activating (start) since Sat 2023-03-04 11:25:37 CET; 38s ago Process: 20230 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS) Main PID: 20257 (mysqld) Status: "Server shutdown complete" Error: 2 (Nie ma takiego pliku ani katalogu) // there is no such file or directory Tasks: 38 (limit: 18989) Memory: 364.3M CGroup: /system.slice/mysql.service └─20257 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid --skip-grant-tables --skip-networking

mar 04 11:25:37 kuba systemd[1]: Starting MySQL Community Server... mar 04 11:25:40 kuba systemd[1]: mysql.service: Got notification message from PID 20257, but reception only permitted for main PID 20255

I've tried to reinstall mysql multiple times, I purged it, removed /etc/mysql and /var/lib/mysql etc and everytime I end up in the same situation. I need to manually kill the proccess of starting the mysql service to unfreeze the console (ctrl+C dont work). Trying to start the service (with service mysql start) shows nothing and can be terminated with ctrl+c, but apt-get install -f or dpkg --configure -a are freezing after:

mysqld is running as pid 20051

line. I've tried everything I found and nothing helped. The last chance is to reinstall Ubuntu, but I would prefer not to do that.

Score:0
gb flag

It's been a while since you asked that question but I just came across an answer that fixed the same problem for me. Put "NotifyAccess=all" in your Systemd Unit file (or even better in an override.conf file) like this:

[Service]
Type=notify
User=mysql
Group=mysql
PIDFile=/run/mysqld/mysqld.pid
NotifyAccess=all

I don't know if that has any security implications so the usual caveats apply.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.