MySQL takes forever to connect – what is happening?

Just experienced a problem with a MySQL installation, which made all eksternal connections (not to localhost) take a very long time to open, making the MySQL server reach the connection limit and rendering it completely useless.

The problem was that the primary DNS server had died. Apparently MySQL uses reverse DNS when checking connections, by default. This can be turned of my adding skip-name-resolve to the [mysqld] section of the /etc/mysql/my.cnf configuration file and restarting the service.

Leave a comment