Bug #3186 new function: client_ip()
Submitted: 16 Mar 2004 1:52 Modified: 24 Mar 2006 12:39
Reporter: None None Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: DML Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any

[16 Mar 2004 1:52] None None
I was looking for a function to access the IP address the mysql connection is comming from. It's for logging purposes. I was hoping a query similar to this could be made to work:
insert into ... set ip=INET_ATON(client_ip());

How to repeat:
[24 Mar 2006 12:39] Hartmut Holzgraefe
makes sense, SERVER_IP() would be nice, too, esp. in load balancing/failover/replication situations ...
[24 Mar 2006 12:51] Chad MILLER
If you do add them, then please don't use "ip", the slang shorthand for "IP address".  The word "address" is a much better word, and isn't specific to the IP -- the Internet Protocol -- so could be used for any network that MySQL might run on.