I'm on Ubuntu, switched from MySQL to MariaDB. Then mariadb does not start at boot, it stay stucked.
So I've done the @Ale's tip (mariadb.service start stuck at activating):
sudo systemctl stop mariadb
echo "/usr/sbin/mysqld { }" | sudo tee /etc/apparmor.d/usr.sbin.mysqld
sudo apparmor_parser -v -R /etc/apparmor.d/usr.sbin.mysqld
But:
sudo apparmor_parser -v -R /etc/apparmor.d/usr.sbin.mysqld
Cache read/write disabled: interface file missing. (Kernel needs AppArmor 2.4 compatibility patch.)
Warning: unable to find a suitable fs in /proc/mounts, is it mounted?
Use --subdomainfs to override.
and:
sudo apt install apparmor
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
apparmor is already the newest version (3.0.4-2ubuntu2.4).
I don't known how to disable this apparmor thing?!
I've already uninstalled, reinstalled mariadb, without purge (I have some databases), and nothing change. If someone have an idea, please share. The server have been upgraded, and is now on 24.04.2 LTS.
I guess that it was a problem with Ubuntu upgrade from previous version to 24 and the switch from MySQL to MariaDB.
When I start the server, systemctl status mariadb.service give:
○ mariadb.service - MariaDB 10.5.21 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; indirect; vendor preset: enabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: inactive (dead)
Docs: man:mariadbd(8)
https://mariadb.com/kb/en/library/systemd/
If I stop and restart it, it goes well.