Yes, everything is identical.
This is the error that the container displays in the log:
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2 “No such file or directory”)
And this error is repeated 60 times until the machine gives up.
But I have found out something. The machine on which the container is running properly has 1 GB RAM, the machine with the error only has 0.5 GB of RAM. I have now set up a swap file with 1 GB RAM there.
The container is now running correctly. The error therefore seems to be related to the lack of memory.
However, the log file also shows the error mentioned above, but surprisingly the server starts nevertheless:
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2 “No such file or directory”)
mariadb33 => Waiting for confirmation of MySQL service startup DONE
And I can access the database via the container:
id=master && my=$(docker ps -a | grep “$id.” | grep -v “xited” | awk ‘{print $1}’) && $(docker exec -it $my mysql -e “SET GLOBAL max_connections = 1000”) && docker exec -it $my mysql my_db
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 10.1.26-MariaDB MariaDB ServerCopyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
MariaDB [my_db]> SHOW TABLES LIKE ‘%’;
At the moment, the case seems to be halfway resolved. As long as I don’t get this error again, I can’t investigate further. It remains strange that the creation of the socket should have been prevented by the lack of memory and that the error also occurs when setting up a swap file, but has no effect.
I am waiting for an explanation.