Fix MariaDB 10.5 “Can’t create test file” errors

Posted on January 9, 2021 at 1:44 pm

I found some issues on recent MariaDB 10.5 installation.

The problems seem related to the new protections applied by MariaDB.

Here is how I fixed them:

1) Could not increase number of max_open_files

sed -i 's/LimitNOFILE=16384/LimitNOFILE=150000/' /etc/systemd/system/mysqld.service
sed -i 's/LimitNOFILE=16384/LimitNOFILE=150000/' /lib/systemd/system/mariadb.service
systemctl daemon-reload

2) Can’t create test file lower-test

sed -i 's/ProtectSystem=full/ProtectSystem=/' /etc/systemd/system/mysqld.service
sed -i 's/ProtectSystem=full/ProtectSystem=/' /lib/systemd/system/mariadb.service
sed -i 's/ProtectHome=true/ProtectHome=false/' /etc/systemd/system/mysqld.service
sed -i 's/ProtectHome=true/ProtectHome=false/' /lib/systemd/system/mariadb.service
sed -i 's/PrivateDevices=true/PrivateDevices=/' /etc/systemd/system/mysqld.service
sed -i 's/PrivateDevices=true/PrivateDevices=/' /lib/systemd/system/mariadb.service
systemctl daemon-reload
chmod 755 /var/lib/mysql

References:

https://dba.stackexchange.com/a/199710
https://stackoverflow.com/a/41558145

Receive updates via email

Other Posts

Updated Posts