MariaDB not working on Debian 9 LXC

encore

Well-Known Member
May 4, 2018
108
1
58
36
Hi,

when I try to install MariaDB on a Debian 9 LXC container (template downloaded from proxmox) I keep getting:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")

Check this:
https://prnt.sc/n8d21e
https://prnt.sc/n8d270

Anyone else has this issue and knows a workaround?
 
Works fine for me. Can you post your container and mariadb/mysql config?
 
I figured out, that mariadb does not work if I have
lxc.apparmor.profile: unconfined
lxc.cgroup.devices.allow: a
lxc.cap.drop:
at the end of the specific container config. Once I remove them, mariadb works.
But those lines are needed to avoid the Docker container "permission denied" start error.
Anyone knows how to make a LXC Debian 9 container work for docker and mariadb?

@oguz
Here the complete config:
Code:
arch: amd64
cores: 2
cpulimit: 2
hostname: vps-58796-1.xxxx.com
memory: 2048
net0: name=eth0,bridge=vmbr0,gw=xxxxxxxxxx,hwaddr=A2:A1:35:9F:D5:7B,ip=xxxxxxx/24,rate=12.5,type=veth
onboot: 1
ostype: debian
rootfs: captive009-lxcstor-02-LOCAL:1012703/vm-1012703-disk-0.raw,quota=1,size=25G
swap: 0
lxc.apparmor.profile: unconfined
lxc.cgroup.devices.allow: a
lxc.cap.drop:

tested with different mariadb versions, default configs.
 
But those lines are needed to avoid the Docker container "permission denied" start error.
Anyone knows how to make a LXC Debian 9 container work for docker and mariadb?
Enabling the "Nesting" option for the CT should make it possible for you to run Docker in it, without these extra lines you added.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!