change the database host to piwigo_db and see if it works. you can’t reach it with what you’re doing because you didn’t publish the ports, so externally, it’s not accessible (external being your LAN) however, since it shared a custom bridge with piwigo, piwigo can access it using docker dns, as long as you use the container_name of mariadb in piwigo.
that’s ok
it seems both container can communicate together media@jarvis:~ $ docker exec -it piwigo ping piwigo_db
PING piwigo_db (172.19.0.2): 56 data bytes
64 bytes from 172.19.0.2: seq=0 ttl=64 time=0.370 ms
64 bytes from 172.19.0.2: seq=1 ttl=64 time=0.302 ms
64 bytes from 172.19.0.2: seq=2 ttl=64 time=0.258 ms
64 bytes from 172.19.0.2: seq=3 ttl=64 time=0.302 ms
64 bytes from 172.19.0.2: seq=4 ttl=64 time=0.255 ms
64 bytes from 172.19.0.2: seq=5 ttl=64 time=0.358 ms
can you clarify what doesn’t work here, since your ping works? Is it the same “cannot connect to the server” error?
i’m going to guess a little based on
but where you put root, you should put piwigo which is what you defined as the MYSQL_USER for the piwigo database. You may just be getting a host rejection from trying to login as root here