0

Trying to connect to MySQL:

root $ 
root $ docker container ls
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
root $ 
root $ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
root $ 
root $ docker image ls
REPOSITORY           TAG                 IMAGE ID            CREATED             SIZE
basex/basexhttp      latest              3339bf6bc898        3 weeks ago         226MB
twilio/twilio-java   latest              611ab7ece1cf        4 weeks ago         993MB
mysql                latest              0d64f46acfd1        6 weeks ago         544MB
jetty                latest              5f997007f18d        7 weeks ago         522MB
jitsi/web            latest              1fad75476320        2 months ago        483MB
mysql/mysql-server   latest              8a3a24ad33be        2 months ago        366MB
hello-world          latest              bf756fb1ae65        8 months ago        13.3kB
root $ 
root $ docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:tag
Unable to find image 'mysql:tag' locally
docker: Error response from daemon: manifest for mysql:tag not found: manifest unknown: manifest unknown.
See 'docker run --help'.
root $ 
root $ docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql
08cd181cf4f21a0c3c5417c38b6ce59650f6882301331dfecb58191509174a86
root $ 
root $ docker container ls
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                 NAMES
08cd181cf4f2        mysql               "docker-entrypoint.s…"   7 seconds ago       Up 4 seconds        3306/tcp, 33060/tcp   some-mysql
root $ 
root $ docker exec -ti --user root some-mysql bash
root@08cd181cf4f2:/# 
root@08cd181cf4f2:/# mysql -u root -pmy-secret-pw
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
root@08cd181cf4f2:/# 
root@08cd181cf4f2:/# mysql -u root -p            
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
root@08cd181cf4f2:/# 

I'll have to read more carefully the distinction between the MySQL image versus MySQL-server and usage.

That being said, why doesn't the command with tag work:

docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:tag

and is it significant?

1