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

Ads
 

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
How to start learning MySQL?
ModuleNotFoundError: No module named 'Calendar-Month-List-View'
how to create users in LDAP using java?
View the mysql querys by and my Php WebApp
jsp page to add users to mysql database
MySQL How to Topic
Mysql List
Mysql List
How to connect mysql with jsp
how to install anaconda in ubuntu for all users
How to connect to MySQL in JSP?
How alter table in MySQL?
Save profile and image to mysql database, and view the image in another jsp page
how to create users using IBM Tivoi API in jsp/servelet?
ModuleNotFoundError: No module named 'odoo9-addon-product-pricelist-item-list-view'
How to get factorial in mysql
Mysql List Tables
How to Create Custom Picker View in iPhone
How to use between in mysql.
How do I upgrade mysql?
How to connect to MySQL from command prompt?
Mysql Alter View

Ads