Skip to content

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. sock' (2) #2

@pascalandy

Description

@pascalandy

Hi,

I'm getting this error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.
sock' (2)

Details:

[node1] (local) root@10.0.2.3 ~/docker-stack-this/PXC-Cluster
$ # Find the ID for galera_proxy
[node1] (local) root@10.0.2.3 ~/docker-stack-this/PXC-Cluster
$ ctn_NAME=galera_proxy && \
> ctnID=$(docker ps -q --filter label=com.docker.swarm.service.name=$ctn_NAME)
[node1] (local) root@10.0.2.3 ~/docker-stack-this/PXC-Cluster
$ echo "$ctnID"
d2eeee1f793d
[node1] (local) root@10.0.2.3 ~/docker-stack-this/PXC-Cluster
$ echo && echo "galera_proxy ID is: $ctnID"

galera_proxy ID is: d2eeee1f793d
[node1] (local) root@10.0.2.3 ~/docker-stack-this/PXC-Cluster
$ echo && echo


[node1] (local) root@10.0.2.3 ~/docker-stack-this/PXC-Cluster
$ docker exec -it $ctnID mysql -uproxyuser -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.
sock' (2)
[node1] (local) root@10.0.2.3 ~/docker-stack-this/PXC-Cluster

You can quickly recreate my setup using play-with-docker. See the steps I have done here: https://github.com/pascalandy/docker-stack-this/tree/master/PXC-Cluster

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions