- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Is there any whoami function or command in MySQL like UNIX?
There is no whoami function in MySQL. The whoami can be used to know the current user in UNIX. Use user() or current_user() function from MySQL for the same purpose.
The following is the output.
+-----------+ | version() | +-----------+ | 8.0.12 | +-----------+ 1 row in set (0.00 sec)
Case 1 −Using CURRENT_USER() function.
The query to know the current user is as follows.
mysql> select current_user();
The following is the output.
+----------------+ | current_user() | +----------------+ | root@% | +----------------+ 1 row in set (0.00 sec)
Case 2 − Using USER() function.
The query is as follows −
mysql> select user();
The following is the output.
+----------------+ | user() | +----------------+ | root@localhost | +----------------+ 1 row in set (0.00 sec)
- Related Articles
- Is there anything like substr_replace in MySQL?
- Is there any alternative for CONCAT() in MySQL?
- Top 10 UNIX Command Line Mistakes
- Is there a MySQL command to convert a string to lowercase?
- What are heterotrophs? Is there is any difference between heterotrophs or heterotrophic?
- Is there any way to check if there is a null value in an object or array in JavaScript?
- Is there any way I can call the validate() function outside the initValidation() function in JavaScript?
- Is there a way to find last date of month using any function? Like 03/15/2017 should return 03/31/2017? (SAP)
- Upgrading MySQL Binary or Package-based Installations on Unix/Linux
- Is there a way to list all the reserved words in MySQL using the MySQL command-line utility?
- Is there any easy way to add multiple records in a single MySQL query?
- Is there something available in Python like PHP autoloader?
- Is there any Python object inspector?
- Program to check there is any forward path in circular cyclic list or not in Python
- Program to check there is any common reachable node in a graph or not in Python

Advertisements