How to view a list of MySQL users and their privileges?

How to view a list of MySQL users and their privileges?

Hi,

How to view a list of MySQL users and their privileges? It want to view these two information in just one query.

Thanks

View Answers

November 5, 2017 at 7:10 PM

Hi,

Today I will teach you sql command to view list of users and their privileges in MySQL database.

If you have many users and databases on production server then you can easily view list of all the users and their privileges. This command is very helpful to see users on a production environment where multiple users are created for different databases.

Here is the command:

 select user,host from mysql.user;

This command gives following output:

mysql>  select user,host from mysql.user;
+------------+-----------+
| user       | host      |
+------------+-----------+
| webservice | %         |
| root       | 127.0.0.1 |
| root       | ::1       |
| root       | localhost |
| webservice | localhost |
+------------+-----------+
5 rows in set (0.00 sec)

mysql>

Thanks

Ads









Related Tutorials/Questions & Answers:
How to view a list of MySQL users and their privileges?
How can I show users privileges in MySQL?
Advertisements
How to get a list of MySQL user accounts?
How to get a list of MySQL user accounts?
How to map MySQL View and Hibernate framework
How to map MySQL View and Hibernate framework
How to view database for user when they login in netbeans and mysql?
how to retreive data dynamically from mysql to drop down list
View Photo From Db MySql
View the mysql querys by and my Php WebApp
jsp page to add users to mysql database
ModuleNotFoundError: No module named 'Calendar-Month-List-View'
Mysql List
Mysql List
how to create users in LDAP using java?
How to start learning MySQL?
Save profile and image to mysql database, and view the image in another jsp page
MySQL How to Topic
how to install anaconda in ubuntu for all users
Mysql List Tables
How to connect mysql with jsp
ModuleNotFoundError: No module named 'odoo9-addon-product-pricelist-item-list-view'
How to connect to MySQL in JSP?
Mysql Alter View
How alter table in MySQL?
how to create users using IBM Tivoi API in jsp/servelet?
How to Create Custom Picker View in iPhone
How to connect to MySQL from command prompt?
view data from database using drop down list
How do I upgrade mysql?
How to get factorial in mysql

Ads