Results 1 to 2 of 2

Thread: MySQL get the client IP when SKIP-NAME-RESOLVE is disabled

  1. #1

    Thread Starter
    PowerPoster make me rain's Avatar
    Join Date
    Sep 2008
    Location
    india/Hubli
    Posts
    2,208

    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
    The averted nuclear war
    My notes:

    PrOtect your PC. MSDN Functions .OOP LINUX forum
    .LINQ LINQ videous
    If some one helps you please rate them with out fail , forum doesn't expects any thing other than this

  2. #2
    Frenzied Member
    Join Date
    Dec 2014
    Location
    VB6 dinosaur land
    Posts
    1,191

    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
  •  



Click Here to Expand Forum to Full Width