Comments - What to Do if MariaDB Doesn't Start

7 years, 3 months ago Damien Norris

Further to the Debian 9 issue where you get Permission Denied if your data dir is located under /home....

The correct way to override this setting is to make a local copy in /etc/systemd/system:

1: sudo cp /lib/systemd/system/mariadb.service /etc/systemd/system

2. Edit /etc/systemd/system/mariadb.service and change ProtectHome to be false (ProtectHome=false). Save the file

3. sudo systemd daemon-reload # refresh the systemd services so it sees your override file

4. sudo systemctl start mysql # and it should finally start

I spent ages searching for AppArmor and SELinux fixes to this problem, when it's just systemd preventing MySQL from writing to /home.

 
6 years, 12 months ago Daniel Black

The more correct is to create /etc/systemd/system/mariadb.service.d/homedir.conf

[Service]
ProtectHome=false

This way the rest of the systemd file is preserved and other changes during upgrade still occurs. See MariaDB systemd documentation: https://mariadb.com/kb/en/library/systemd/. Thanks for contributing, this form of failure sure be documented here too.

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.