I'm running on an Ubuntu 19.04 distro and have a Dockerfile which when we reach step 7;
Step 7/11 : RUN (/usr/bin/mysqld_safe &); sleep 5; mysqladmin -u root -proot create wordpress
we get;
2019-10-09T12:18:34.365421Z mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists.
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Looking at the error message: mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists.
cookie@cookie-K501UX:~/code/docker$ ls -la /var/run/mysqld
total 8
drwxr-xr-x 2 mysql mysql 100 Oct 9 13:10 .
drwxr-xr-x 36 root root 1060 Oct 9 13:10 ..
-rw-r----- 1 mysql mysql 6 Oct 9 13:10 mysqld.pid
srwxrwxrwx 1 mysql mysql 0 Oct 9 13:10 mysqld.sock
-rw------- 1 mysql mysql 6 Oct 9 13:10 mysqld.sock.lock
it does. And Check that mysqld is running
$ sudo systemctl status mysql
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-10-09 13:26:21 BST; 8min ago
it is. If the socket file exists and the MySQL daemon is running - what's the problem?
Dockerfile
was from here:https://github.com/how2dock/docbook/blob/master/ch01/supervisor/Dockerfile
– cookie Oct 10 '19 at 08:07Ubuntu 19.04
andmysql
is no bueno. Rather it should be more likeUbuntu 19.04
andmariadb
. I've answered my own question essentially. – cookie Oct 10 '19 at 08:11Dockerfile
config for a modern Wordpress install and post my findings. – cookie Oct 10 '19 at 08:19