MySQL Forums
Forum List  »  Security

Re: ip address to host name
Posted by: Georgi Kodinov
Date: February 20, 2017 08:10AM

What you're doing yields expected results.

But you need to understand that the user account is used based on what the *server* sees and not what you put on the client's command line.

The server receives the numerical IP of the incoming connection and then (if the --skip-name-resolve is off) does a reverse DNS lookup for it (locally cached) and then uses the resulting symbolic host name from then on.

So the only ways I can think of to actually use the gnchen@192.168.8.6 are:
* The server running with --skip-name-resolve
* The reverse DNS lookup fails (no symbolic name known to the server's resolver)

The above works only for IPv4 connections. MySQL would listen to ::1 IPv6 too, so in some cases you will receive the IPv6 IP instead of the IPv4 IP you specified above. And then that will be used for the eventual reverse DNS lookup.

Now you need to ask yourself what exactly do you want to achieve.
By default the server comes with a single "root@localhost" account and this is what I would recommend using too (since it's IPv4 and IPv6 compatible).

This will of course cause an extra DNS lookup. But this is a price most users can live with as a cost for simplicity.

Note also gnchen@192.168.8.6 is completely separate form gnchen@test. This means there's two authentication methods (and passwords) that need maintenance and there's two sets of grants too !

Options: ReplyQuote


Subject
Views
Written By
Posted
1976
February 14, 2017 09:07AM
Re: ip address to host name
809
February 20, 2017 08:10AM
527
February 20, 2017 07:09PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.