I have troubles configuring a new MySQL connection with ODBC Data Sources (64bits) utility on a Windows Server 2019. I'm using MySQL Workbench to define remote accesses as follow:
The user is granted a SELECT
only access:
I have noticed that the server from which I need to initiate the connection (srv-bo
) has a static IP address that had already been used in the past by another server (srv-mooc
). The ancient remote server entry persisted in the domain controller DNS, so I deleted it. Since then, the ODBC Data Sources (64bits) utility keeps trying to connect with the ancient server's name (srv-mooc
)... It seems that some connection informations are kept in memories somewhere but I can't figure it out.
So far, I have tried to flush the DNS cache on my Windows Server 2019 from which I initiate the connection. I have also tried to set up the connection from another user session and after server reboot. Issue is still there:
Error message:
The user credentials work fine from another Windows Server 2019, so connection details are good.
Any idea to help?
Thomas
It's quite possible MySQL is maintaining an internal DNS cache of hosts. For a quick and dirty test, try
SET GLOBAL host_cache_size=0;
on the server (if DNS load is a concern, remember to reset it to a non-zero value after testing).Edit: For a 5.5 MySQL try a
FLUSH HOSTS;
References: https://dev.mysql.com/doc/refman/8.0/en/host-cache.html#host-cache-flushing http://download.nust.na/pub6/mysql/doc/refman/5.5/en/dns.html
You can try to edit this file
C:\Windows\System32\drivers\etc\hosts
in which are stored all local DNS records. Also please check what is the answer of the current DNS server Windows uses, looks like it has a PTR record somewhere.After loads of searches and precious help in the various comments, I eventually managed to solve the issue by executing a
FLUSH HOSTS;
SQL query within query editor on the remote server.See MySQL 5.5 documentation here.