If we want to manage a database in MySQL, it is required to see the list of all user’s accounts in a database server. The following command is used to check the list of all users available in the database server:
mysql> SELECT USER FROM mysql.user;
To check the users in MySQL, you can use the following SQL query:
SELECT User, Host FROM mysql.user;
This will retrieve a list of users along with their corresponding hostnames from the MySQL user table.