4

I just installed MariaDB and the status is :

* mariadb.service - MariaDB 10.3.18 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2020-01-28 15:29:00 UTC; 2s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/

Jan 28 15:29:00 54 systemd[1]: Starting MariaDB 10.3.18 database server...
Jan 28 15:29:00 54 systemd[29206]: mariadb.service: Failed to set up mount namespacing: Permission denied
Jan 28 15:29:00 54 systemd[29206]: mariadb.service: Failed at step NAMESPACE spawning /usr/bin/install: Permission denied
Jan 28 15:29:00 54 systemd[1]: mariadb.service: Control process exited, code=exited, status=226/NAMESPACE
Jan 28 15:29:00 54 systemd[1]: mariadb.service: Failed with result 'exit-code'.
Jan 28 15:29:00 54 systemd[1]: Failed to start MariaDB 10.3.18 database server.

Can I have some help to start MariaDB Thx

Kanarpp
  • 149
  • 2
  • 2
  • 11

2 Answers2

16

This question is quite old – but since I found it through Google after running into the same issue, here’s my solution:

The problem started occurring after updating a MariaDB instance running inside an LXC container.

As a quick fix, I created /etc/systemd/system/mariadb.service.d/lxc.conf with the following contents:

[Service]
ProtectHome=false
ProtectSystem=false

# These settings turned out to not be necessary in my case, but YMMV
#PrivateTmp=false
#PrivateNetwork=false
#PrivateDevices=false

After that, run systemctl daemon-reload and systemctl restart mariadb and everything should work again.

hanzi
  • 2,877
  • 18
  • 26
  • I doubt this is the correct answer. The error clearly states that the problem happens in the line `ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld` . Indeed the proposed solution does not solve the problem. – am70 Jan 08 '21 at 10:46
  • 2
    @am70 The error also states 'Permission denied', indicating that some security feature is getting in the way. Which is what my configuration file is disabling. I ran into this issue several times and this solution always did the trick. I'm sorry it doesn't work for you, perhaps there's some other underlying cause. – hanzi Jan 08 '21 at 17:43
  • 4
    This solved the issue for me after upgrading from stretch to buster, but I had to uncomment the line `#PrivateDevices=false` – RazZziel Jan 31 '21 at 12:49
  • 1
    I can confirm that after creating an LXC container on Proxmox and installing the latest MariaDB (10.5.9), I had the same issue with starting Mariadb on Debian 10. Creating the file and using the above settings/commands made it work. Thank you! – G Trawo May 04 '21 at 14:51
  • 1
    In a debian lxc container after removing the php version this error occurred. And this solution was successful. But in my case the commented out lines were important to success. So Thank you. – row Jan 10 '22 at 09:27
5

I had to do both:

ProtectHome=false
ProtectSystem=false

and uncomment:

#PrivateDevices=false
Gh05d
  • 7,923
  • 7
  • 33
  • 64
user15378522
  • 51
  • 1
  • 1