How to get a list of MySQL user accounts?

How to get a list of MySQL user accounts?

Hi,

I have MySQL database and I created many users for different databases. I want to see the names of all the users.

How to get a list of MySQL user accounts?

Thanks

View Answers

November 5, 2017 at 6:56 PM

Hi,

In MySQL users information is stored in user table of mysql datababse (mysql.user).

To view the list of all the users you have to run the query to list all data from mysql.user table.

Here is query to see all the user accounts in MySQL:

SELECT User FROM mysql.user;

If you run the command it will print following output with list of users:

mysql> SELECT User FROM mysql.user;
+------------+
| User       |
+------------+
| webservice |
| root       |
| root       |
| root       |
| webservice |
+------------+
5 rows in set (0.10 sec)

mysql>

Thanks









Related Tutorials/Questions & Answers:
How to get a list of MySQL user accounts?
How to get a list of MySQL user accounts?
Advertisements
How to get factorial in mysql
user in mysql
How to view a list of MySQL users and their privileges?
How to view database for user when they login in netbeans and mysql?
how can i send a mail to a particular user from a many user dropdown list in jsp
how to get the details of username&password of mysql - JDBC
Java get User Home
How to get a list of all indexes in python-elasticsearch
Java get User Input
how to retreive data dynamically from mysql to drop down list
Mysql List
Mysql List
MySql Alter User
How to get unique list in Hibernate using Criteria Query?
how to get data from list to map with out using a loop?
ModuleNotFoundError: No module named 'get-user-headers'
How would I get this linked list in alphabetical order?
How to get of lastmodified file list between two times in java?
How Insert DateTime Vales into Mysql Databse from the front end application.But User Gives Date only from Datepicker,not Time
How Insert DateTime Vales into Mysql Databse from the front end application.But User Gives Date only from Datepicker,not Time
MySQL How to Topic
Get the list of tables in Sybase
get files list - Ajax
How to "Get data froom MySQL DB on giving a value in a tex-box in a JSP file."
please let me get code how to insert a data to mysql using setter and getter method by using java
please let me get code how to insert a data to mysql using setter and getter method by using java
jsp page to add the user to mysql database
Mysql List Tables
Save the input data until user get changed
Save the input data until user get changed
Save the input data until user get changed
Mysql Date Get Year
PHP list box mysql
How to read user input in C++
ModuleNotFoundError: No module named 'get_list'
ModuleNotFoundError: No module named 'get_list'
simple code to login user & authenticate it from database mysql
How to prompt user
How to start learning MySQL?
Get values in drop down list
Mysql List Tables
get info from mysql using jsp and servlet
How to connect mysql with jsp
get and display blob from mysql on jsf
How to connect to MySQL in JSP?
ModuleNotFoundError: No module named 'get_every_list'
mysql error 1042 can't get hostname for your address
JSP Get Data Into Dropdown list From Database

Ads