0

MySql is used here with remote network connections, and after a reboot of the server these connections started taking 20-30 seconds to connect causing timeouts. Connections used to be nearly instant.

Adding skip-name-resolve fixes the delay as remote connections address the database by its IP address, however, this MySql server also hosts an email login database for an internal email server. The skip-name-resolve fix breaks all email logins from clients and servers.

The email server is a Postfix/Dovecot stack and using IMAP RoundCube Server and Thunderbird clients. I cannot figure out where in the email stack that addresses MySql configuration needs to be changed.

It seems the root of the problems would be a DNS issue, maybe an expired domain name in the configs somewhere. I spent hours looking and need some advice on tackling this. I'd rather solve the root DNS issue, if that's the problem - like track down an expired domain name or fault in the DNS addressing.

1 Answer 1

0

Workaround:

Keeping skip-name-resolve in place, I changed shunned users having non-IP number hostnames in the users table as follows:

UPDATE mysql.user SET Host='127.0.0.1' WHERE Host='localhost' AND User='username';
UPDATE mysql.db SET Host='127.0.0.1' WHERE Host='localhost' AND User='username';
FLUSH PRIVILEGES;

I will delve into the DNS problem when I have a spare weekend.

(Changed % to 127.0.0.1 as requested in a comment, as with % everyone would be able to access MySQL with username, with no IP checks. localhost is resolved as 127.0.0.1 in most cases (see your /etc/hosts). - [ed.])

3
  • Strange, localhost used to work despite turned off resolving for me. Maybe it’s a /etc/hosts thing?
    – eckes
    Commented Jan 20, 2018 at 23:43
  • For me it was way much more convenient to use % instead of 127.0.0.1 and just block port 3306 on the firewall (ufw in case of Ubuntu). Thanks to the firewall, only local users can connect and MySQL does not need to do any sort of host checking.
    – Zoltan
    Commented Mar 1, 2019 at 10:32
  • In mariaDB >=10.5, mysql.user is just view(not table). So You can use rename to do this. ex) RENAME USER username@localhost TO [email protected];
    – Meow Kim
    Commented Mar 22, 2022 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.