From ae533965d6fc594b438b0b9cf9681bd425fb19cf Mon Sep 17 00:00:00 2001 From: James Page Date: Wed, 25 Jan 2017 09:25:23 +0000 Subject: [PATCH] Disable hostname resolution MySQL automatically attempts to resolve hostnames to IP addresses, mapping to ACL entries for users; this adds overhead for each connection, and when DNS is wonky in some way can cause access issues. Use 'skip-name-resolve' to ensure that only IP addresses are used with checking ACL's. Change-Id: Idf55ddc3090da97a96dd0bbc30fc845f65d1692c Partial-Bug: 1599222 --- templates/my.cnf | 4 ++++ templates/mysqld.cnf | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/templates/my.cnf b/templates/my.cnf index bf6a605..921c91a 100644 --- a/templates/my.cnf +++ b/templates/my.cnf @@ -1,6 +1,10 @@ # Juju managed file - don't change as charm will overwrite your changed! [mysqld] +# Never resolve IP's to hostnames; it adds overhead +# and is not really reliable for use with ACL's. +skip-name-resolve + {% if bind_address %} bind-address = {{ bind_address }} {% endif %} diff --git a/templates/mysqld.cnf b/templates/mysqld.cnf index b75a5f4..114133d 100644 --- a/templates/mysqld.cnf +++ b/templates/mysqld.cnf @@ -12,6 +12,10 @@ tmpdir = /tmp lc-messages-dir = /usr/share/mysql skip-external-locking +# Never resolve IP's to hostnames; it adds overhead +# and is not really reliable for use with ACL's. +skip-name-resolve + # # * Networking #