I had a working MySQL install and I tried to migrate it to MariaDB. I also have Docker, which seems to block /usr/sbin/mysqld via AppArmor.
To be clear, I’m not using Docker currently (but I’d like to not have to remove it since I will be using it soon).
The problem I’m having is when I’m trying to load my project, served by good old Apache, in the browser. I’m getting a SQLSTATE[HY000] [2002] No such file or directory
error message.
The workaround right now is to force AppArmor to unblock mysqld:
sudo apparmor_parser -v -R /etc/apparmor.d/usr.sbin.mysqld && sudo systemctl restart mariadb
This works, but I have to redo it after every system boot.
aa-status
clearly shows who the culprit is:
4 processes are in enforce mode.
...
/usr/sbin/mysqld (2960) docker-default
After running the workaround above, this line disappears from aa-status
and everything works perfectly.
How can I permanently disable this "protection" from the docker-default
profile?