Lxd connection problem


I installed lxd --channel 4.0/stable, and i have 2 containers:

  • ng-tst (with nginx and php-fpm)
  • db (with mariadb)

From windows i can ssh into both.
With dbeaver i can connect to db and create databases and look at global variables:

  • bind-address =
  • port = 3306

The 2 containers can ping each other.

But when a php script in ng-tst wants to make a pdo connection with db, i get:

SQLSTATE[HY000] [2006] MySQL server has gone away

I tried with host=ip and host=db.lxd, but same result.

I don’t know where to look, any pointers would be very welcome.

Maybe confirm that you can ping db from ng-tst and if you can, try connecting to mariadb using the command line client from ng-tst to isolate things a bit.

Ping: works

mysql -u main3 -h -p
ERROR 1045 (28000): Access denied for user ‘main3’@‘ng-tst.lxd’ (using password: YES):

The user is defined as ‘main3’@’%’

Sorry, connection was ok, i used a wrong password.
So i suppose it is rather a php problem, and not a lxc problem.

Everything is ok now.
The problem was me, a mix-up of passwords.
Sorry to have bothered you.

Ah, good that it was a simple problem :slight_smile: