简体   繁体   中英

Can't connect to MYSQL server on '127.0.0.1' (10061) after upgrade docker desktop

Recently I have upgraded docker desktop. Once upgrade finished I tried to connect MYSQL server in localhost. It failed with following error.

> Can't connect to MYSQL server on '127.0.0.1' (10061)

Docker Desktop version - 4.2.0 (70708)

Please let me know how to resolve this if someone have similar experience.

=========================Updates=========================

I'm running php application on laradock.

docker ps -a

    PS D:\Projects\ProjectGroup\laradock> docker ps -a
CONTAINER ID   IMAGE                 COMMAND                  CREATED        STATUS                     PORTS                                                                                                                            NAMES
37b2bb2494fa   b8cd9cd05715          "docker-entrypoint.s…"   3 days ago     Exited (1) 3 days ago                                                                                                                                       practical_swanson
a81d736ffbfe   laradock_beanstalkd   "/usr/bin/beanstalkd"    6 months ago   Up 2 minutes               0.0.0.0:11300->11300/tcp                                                                                                         laradock_beanstalkd_1
aa8c1191224b   laradock_php-fpm      "docker-php-entrypoi…"   6 months ago   Up 2 minutes               9000/tcp, 0.0.0.0:9003->9003/tcp                                                                                                 laradock_php-fpm_1
4a7fdbd4877c   laradock_workspace    "/sbin/my_init"          6 months ago   Up 2 minutes               0.0.0.0:3000-3001->3000-3001/tcp, 0.0.0.0:4200->4200/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:2222->22/tcp, 0.0.0.0:8001->8000/tcp   laradock_workspace_1
ed117dab98a5   laradock_redis        "docker-entrypoint.s…"   6 months ago   Up 2 minutes               0.0.0.0:6379->6379/tcp                                                                                                           laradock_redis_1
b68934b410d8   laradock_apache2      "/opt/docker/bin/ent…"   6 months ago   Up 2 minutes               0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp                                                                                         laradock_apache2_1
b5fa4d4736f1   b8cd9cd05715          "docker-entrypoint.s…"   6 months ago   Exited (1) 2 minutes ago                                                                                                                                    laradock_mysql_1
85bf7864c73d   docker:19.03-dind     "dockerd-entrypoint.…"   6 months ago   Up 2 minutes               2375-2376/tcp                                                                                                                    laradock_docker-in-docker_1
1a778708e98b   b9e19965963f          "/bin/sh -c 'if [ ${…"   2 years ago    Exited (100) 2 years ago                                                                                                                                    hardcore_clarke

Thanks

Probably not the upgrade made your mysql unavailable, but the docker daemon restart which happens with the upgrade.

A docker ps will list your running containers, likely you will see here an empty list. A docker ps -a will list also your not running containers, the mysql will be likely among them.

There is no way to restart a stopped container, but in the docker world, you also do not need it. You have some way to start your mysql container (most likely a docker run... command), start it again. The persistent data is likely on a docker volume, which is visible for your container, so it will likely not affected by that. (It depends on the container you are using, but that is the typical scenario.)

If you container do not start or your persistent data went off, then probably the container is not very well configured and you have a data recovery task (which will likely have a positive outcome).


Extension: your mysql container (named laradock_mysql_1 ) has exited and it does not run. It is also created by docker-compose. Restart it ( docker compose up -d ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM