You might look at the USER() and CURRENT_USER() functions. 

http://dev.mysql.com/doc/mysql/en/Information_functions.html

However, I think those will end up showing you the NAT server's address 
and not the user's un-NATed address.  If it were simple to de-NAT an 
address, most firewalls would become very ineffective. That's what NAT is 
there to do, protect the user behind the firewall by obscuring their 
internal address, right?

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

Laszlo Thoth <[EMAIL PROTECTED]> wrote on 09/30/2004 02:34:35 PM:

> Quoting Mazhar Bilen <[EMAIL PROTECTED]>:
> 
> > Use this variable:
> >
> > $REMOTE_ADDR.
> >
> > Such that:
> >
> > $client_IP = $REMOTE_ADDR;
> > UPDATE clients SET ipaddr= $client_IP WHERE [EMAIL PROTECTED];
> 
> This doesn't appear to work: I don't think the MySQL server recognizes
> $REMOTE_ADDR as anything meaningful.  Perhaps you're referring to 
> the case in a
> PHP or Perl script where $REMOTE_ADDR is meaningful, and this value is 
being
> substituted into the string before the query is sent to MySQL?
> 
> Unfortunately that solution is not appliable to my problem.  I'm talking
> directly from a remote NAT'ed client to an SQL server without any 
Perl/PHP
> intermediary.  I need a way to identify the client's IP address from the 
bare
> SQL server.
> 
> mysql> SELECT NOW() FROM nodes;
> 2004-09-30 11:27:53
> 
> mysql> SELECT $REMOTE_ADDR FROM nodes;
> ERROR 1054 (42S22): Unknown column '$REMOTE_ADDR' in 'field list'
> 
> mysql> select "$REMOTE_ADDR" FROM nodes;
> $REMOTE_ADDR
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
> 

Reply via email to