Installing MySQL in Docker fails with error message “Can't connect to local MySQL server through socket”

后端 未结 13 1484
轻奢々
轻奢々 2020-12-13 01:53

I\'m trying to install mysql inside a docker container,Tried various images from github, it seems they all manage to successfully install the mysql but when I try to run the

13条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-13 02:04

    In my case I tried to connect to DB (which was inside docker) like this:

    mysql -ppass -u root
    

    but got same error as OP.

    Specifying host and port helped:

    mysql --host 0.0.0.0 --port 3306 -ppass -u root
    

提交回复
热议问题