MySQL clinet's hostname
Posted by: KRM R
Date: July 11, 2013 04:27PM

Hello All,

I am trying to write a audit trigger for MySQL user login. I want to insert the username, timestamp, user session Id, host name from which the user/client is initiating the connection to my audit table. I don't want to give SELECT on information_schema, mysql schema to my developers. Is there a function to find a user/client's host name?

I found the CURRENT_USER() function, but it is actually returning the hostname used for authentication. Since we create usernames with "%" for hostname so that they can login from anyhost. The above function returns "%" for all user sessions.

ex: select CURRENT_USER();
blahblah@%.

Any inputs are greatly appriciated.

Thanks.

Options: ReplyQuote


Subject
Written By
Posted
MySQL clinet's hostname
July 11, 2013 04:27PM


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.