Very often, this is a reverse lookup DNS problem.
When connecting to MySQL, MySQL will try to determine the host name for the IP address just connected to it. If MySQL cannot reach the DNS server for this, there is a timeout of 5 s.
Try starting MySQL with
[mysqld] skip-name-resolve
in my.ini file and check if the problem has disappeared. Please note that setting this parameter means that you create user grants with IP numbers only ("GRANT ALL TO USER @ 10.1.1.1 ...") instead of using domain names.
If this option fixes the problem, enter DNS in order, and you can remove this option.
source share