Skip to content

Wrong socket path when connecting from within container #829

Closed
@aprat84

Description

@aprat84

Steps to reproduce:

  1. Start a container docker run --name mysql-test -e MYSQL_ROOT_PASSWORD=password -d mysql:8.0-oracle
  2. Open a shell inside container docker exec -it mysql-test bash
  3. Execute mysql or mysql -u root -p or mysql -u root -ppassword

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

Real socket path is /var/run/mysqld/mysqld.sock, so I really don't know how it tries to connect to /var/lib/mysql/mysql.sock.

PS: I know I can specify the host, as mysql -h 127.0.0.1 -u root -p, and it works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions