title: MySQL connection throws an error after a long wait
body: <p>I am gonna crash my laptop. I reistalled mysql and docker bunch of times, cause every time i create docker container and connect to it through mysql i have an error. Every time error is unique. NOW, when i connect with the bash command <code>mysql -h 127.0.0.1 -P80 -u root -p</code>
  i wait about 4 minutes and then get an error:</p>
  <blockquote>
  <p>ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0</p>
  </blockquote>
  <p>BUT, 1 hour before i created docker container and connected to it through mysql and all succseded. I've run out of energy and ideas</p>
  <p>If somebody wants to recommend to enter <code>mysqld: ALL</code> to hosts.deny/allow - NO. I already did that</p>
  <p>MySQL service status:</p>
  <pre><code>mysql.service - MySQL Community Server
       Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
       Active: active (running) since Sun 2022-05-08 22:15:54 MSK; 10min ago
      Process: 27811 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
     Main PID: 27819 (mysqld)
       Status: &quot;Server is operational&quot;
        Tasks: 37 (limit: 9348)
       Memory: 399.1M
       CGroup: /system.slice/mysql.service
               └─27819 /usr/sbin/mysqld
  
  мая 08 22:15:35 rolf-pc systemd[1]: Starting MySQL Community Server...
  мая 08 22:15:54 rolf-pc systemd[1]: Started MySQL Community Server.
  </code></pre>
  <p>Docker status:</p>
  <pre><code>docker.service - Docker Application Container Engine
       Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
       Active: active (running) since Sun 2022-05-08 20:02:04 MSK; 2h 26min ago
  TriggeredBy: ● docker.socket
         Docs: https://docs.docker.com
     Main PID: 24218 (dockerd)
        Tasks: 28
       Memory: 104.4M
       CGroup: /system.slice/docker.service
               ├─24218 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
               ├─27632 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8080 -container-ip 172.17.0.2 -container-port 80
               └─27639 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8080 -container-ip 172.17.0.2 -container-port 80
  
  мая 08 20:02:02 rolf-pc dockerd[24218]: time=&quot;2022-05-08T20:02:02.321079125+03:00&quot; level=warning msg=&quot;Your kernel does not support cgroup blkio weight_device&quot;
  мая 08 20:02:02 rolf-pc dockerd[24218]: time=&quot;2022-05-08T20:02:02.321316259+03:00&quot; level=info msg=&quot;Loading containers: start.&quot;
  мая 08 20:02:02 rolf-pc dockerd[24218]: time=&quot;2022-05-08T20:02:02.960223030+03:00&quot; level=info msg=&quot;Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. &gt;
  мая 08 20:02:03 rolf-pc dockerd[24218]: time=&quot;2022-05-08T20:02:03.218556775+03:00&quot; level=info msg=&quot;Loading containers: done.&quot;
  мая 08 20:02:04 rolf-pc dockerd[24218]: time=&quot;2022-05-08T20:02:04.218846606+03:00&quot; level=info msg=&quot;Docker daemon&quot; commit=4433bf6 graphdriver(s)=overlay2 version=20.10.15
  мая 08 20:02:04 rolf-pc dockerd[24218]: time=&quot;2022-05-08T20:02:04.219129724+03:00&quot; level=info msg=&quot;Daemon has completed initialization&quot;
  мая 08 20:02:04 rolf-pc systemd[1]: Started Docker Application Container Engine.
  мая 08 20:02:04 rolf-pc dockerd[24218]: time=&quot;2022-05-08T20:02:04.571320378+03:00&quot; level=info msg=&quot;API listen on /run/docker.sock&quot;
  мая 08 22:12:17 rolf-pc dockerd[24218]: time=&quot;2022-05-08T22:12:17.188503840+03:00&quot; level=info msg=&quot;ignoring event&quot; container=7456bdd6179cde164b5a5ca92970f35a8d696de3b37c3&gt;
  мая 08 22:14:19 rolf-pc dockerd[24218]: time=&quot;2022-05-08T22:14:19.206500663+03:00&quot; level=info msg=&quot;ignoring event&quot; container=7456bdd6179cde164b5a5ca92970f35a8d696de3b37c3&gt;
  </code></pre>
  <p>Container:</p>
  <pre><code>CONTAINER ID   IMAGE          COMMAND                  CREATED          STATUS          PORTS                                                        NAMES
  
  1b0a8e0cab96   mysql:latest   &quot;docker-entrypoint.s…&quot;   15 minutes ago   Up 14 minutes   3306/tcp, 33060/tcp, 0.0.0.0:8080-&gt;80/tcp, :::8080-&gt;80/tcp   TEST_SQL
  </code></pre>