/usr/sbin/mysqld: error while loading shared libraries: liblz4.so.1: cannot open shared object file: Permission denied
This worked for me :-
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
It also disables the AppArmor for MySQL on the system though.
Had the same problem after mariad install and changing datadir to /home/myuser/mysql. This was the issue: https://stackoverflow.com/a/41558145/4556066 ProtectHome=false
This is what worked for me
Follow the steps below to remove mysqld from the app armor:
$ echo "/usr/sbin/mysqld { }" | sudo tee /etc/apparmor.d/usr.sbin.mysqld$ sudo apparmor_parser -v -R /etc/apparmor.d/usr.sbin.mysqld$ sudo systemctl restart mariadb