USER() returns the current MySQL username and hostname : USER « Information Functions « MySQL Tutorial






mysql>
mysql> SELECT USER();
+----------------+
| USER()         |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.00 sec)

mysql>








20.15.USER
20.15.1.USER() returns the current MySQL username and hostname
20.15.2.To extract only the username part