Why does the MySQL built-in function 'current_user()' return a hostname containing a '%' symbol?

Edmhs picture Edmhs · Jan 6, 2011 · Viewed 8.3k times · Source

Does MySQL have built in function to get host name?

Similar to

select user(); //this returns  user@userip

Edit:

select current_user(); //returns [email protected].%

Last symbol is % -- why?

Answer

Joao Costa picture Joao Costa · Oct 21, 2011

SELECT @@hostname;

--mysql 4.1 didn't have this one.