Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/usr/sbin/mysqld: error while loading shared libraries: liblz4.so.1: cannot open shared object file: Permission denied

I'm installing mariadb on ubuntu 16.04.

After Installed, when I run mysql status/start, it always throws the below error

root@3ab94b27a215:~# service mysql status
/usr/sbin/mysqld: error while loading shared libraries: liblz4.so.1: cannot open shared object file: Permission denied
* MariaDB is stopped. 

I find the file here

root@3ab94b27a215:~# find / -name liblz4.so.1
/usr/lib/x86_64-linux-gnu/liblz4.so.1

I set 777 permission to /usr/lib/x86_64-linux-gnu/liblz4.so.1

chmod 777  /usr/lib/x86_64-linux-gnu/liblz4.so.1

but still the error not resolved.

can you please help me on this?

like image 399
Bilal Usean Avatar asked Sep 08 '17 08:09

Bilal Usean


2 Answers

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.

Got from this issue

like image 181
Prashant Verma Avatar answered Nov 12 '22 17:11

Prashant Verma


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
like image 1
AmaChefe Avatar answered Nov 12 '22 16:11

AmaChefe