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

3

11

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?

Djokjakarta answered 8/9, 2017 at 8:13 Comment(0)
A
28

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

Ailing answered 26/2, 2020 at 21:44 Comment(0)
B
2

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
Brockway answered 18/10, 2021 at 20:38 Comment(0)
S
0

Had the same problem after mariad install and changing datadir to /home/myuser/mysql. This was the issue: https://mcmap.net/q/541880/-mariadb-cannot-start-after-update-warning-can-39-t-create-test-file-home-mysql-beta-lower-test ProtectHome=false

Stubbs answered 6/12, 2018 at 5:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.