Comments - What to Do if MariaDB Doesn't Start

 
5 years, 1 month ago Dana Williams

One of the first things you suggest at the top of this document is using these commands to locate the error log and data directory. Will these commands run if "MariaDB Doesn't Start"?

mysqld --help --verbose | grep 'log-error' | tail -1 mysqld --help --verbose | grep 'datadir' | tail -1

 
4 years, 11 months ago Ian Gilfillan

Not always, but in many cases yes.

 
5 years, 7 months ago Jose Linux

I have upgraded clean debian 7 to debian 9 and I have installed mariadb-server-10.1.37 (amd64) in my VPS.

MariaDB doesn't start.

  1. systemctl status mariadb.service
  • mariadb.service - MariaDB 10.1.37 database server Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Sat 2019-01-18 00:56:28 CET; 7s ago Docs: man:mysqld(8) https://mariadb.com/kb/en/library/systemd/ Process: 6183 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=226/NAMESPACE)

ene 18 00:56:28 xxxxx.server.info install[6183]: mariadb.service: Failed at step NAMESPACE spawning /usr/bin/install: Value too large for defined data type

I have googled but I don't find solution for this problem. What can I do to solve it ?

 
7 years, 1 month ago comar

As Leho mentioned it may be also a case, f.e. if you update your Debian 8 installation to Debian 9. I had my datadir symlinked from /var/lib/mysql to my /home/mysql and I was getting errcode 13 Permission denied, even if mysql users had all the chmod's properly set. I had to change ProtectHome to false in /etc/systemd/system/multi-user.target.wants/mariadb.service

 
7 years 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, 9 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.

 
7 years, 5 months ago Leho Kraav

Also watch out for `ProtectHome` and `ProtectSystem` systemd service definition keys, if your data dir happens to live in relevant locations for whatever reason.

 
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.