-
Jun 8th, 2019, 02:46 AM
#1
Thread Starter
PowerPoster
MySQL get the client IP when SKIP-NAME-RESOLVE is disabled
with MySQL 5.7
I need to get the incoming connection IP,
but the server is returning the host name as the part of connection since the SKIP-NAME-RESOLVE is disabled and i don't have the liberty to enable it .
at this situation how can i get the client IP...
A lots of google didn't helped me precisely nor i have a good direction,
Code:
select host from information_schema.processlist where ID = CONNECTION_ID()
the above code should provide me localhost:52574 , but in my case the localhost is replaced by the client host name
-
Jun 10th, 2019, 10:03 AM
#2
Re: MySQL get the client IP when SKIP-NAME-RESOLVE is disabled
Interesting. Did you bother reading the documentation?
The MySQL server maintains a host cache in memory that contains information about clients: IP address, host name, and error information. The Performance Schema host_cache table exposes the contents of the host cache so that it can be examined using SELECT statements. This may help you diagnose the causes of connection problems. See Section 26.12.17.1, “The host_cache Table”. (emphasis added)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|