1

I am aware that when a connection is made to MySQL, MySQL does a reverse lookup on the IP address to determine the host it is coming from.

I have a very odd situation where I have a number of users connecting from the same server and some users are showing as coming from one host (lets say for example "myhost.com") and others are from a different host (lets say "myhost.co.uk")

The config of the connection in both cases is the same. The IP they connect from is the same. The server they connect to is the same. On both client and server PC the reverse lookup of the IP resolves to the same host (e.g. myhost.com). There is only one IP address on the server.

This is causing us problems with authentication because when adding new users (something which is an automated script) we add them using the server IP address as the host, and about 50% of the time, this is not working because when it does the reverse lookup it finds the wrong host name!

I am aware that you can turn off the host lookup in MySQL config, but at this stage I'm reluctant to do that and would rather find an answer to the problem.

asked Mar 14, 2017 at 12:02
3
  • Are there multiple entries in /etc/hosts on either the client or server for the client machine/IP? Commented Mar 14, 2017 at 12:12
  • Hi, no, there are no entries on either server for the client IP Commented Mar 14, 2017 at 12:39
  • how many PTR records does that IP address have? Commented Apr 5, 2021 at 1:52

1 Answer 1

0

Adding the IP and host name to the hosts file on the database server seems to have resolved this problem!

answered Mar 14, 2017 at 18:43

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.