MariaDB cannot start after update: [Warning] Can't create test file /home/mysql/beta.lower-test

To run MariaDB SQL from /home, in the file /usr/lib/systemd/system/mariadb.service, just change :

ProtectHome=true

to :

ProtectHome=false

The answer by Thomas is correct, but get's reset by updates every few months. So here is a permanent solution:

Use systemctl edit mariadb to create a file overwritting the default settings of the mariadb service. (In debian it's located in /etc/systemd/system/mariadb.service.d/override.conf)

Set the same setting Thomas changed in the file:

[Service]
ProtectHome=false

Use systemctl daemon-reload to reload the systemctl config.


On debian 9 you need to change ProtectHome to false in both /lib/systemd/system/mariadb.service and /lib/systemd/system/[email protected] then run sudo systemctl daemon-reload.

Maybe also run sudo grep -Ri "protecthome" /lib/systemd/system to find other instances of ProtectHome in mysql-related files if this still isn't working