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









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?
jsp page to add users to mysql database
how to retreive data dynamically from mysql to drop down list
ModuleNotFoundError: No module named 'Calendar-Month-List-View'
View Photo From Db MySql
View the mysql querys by and my Php WebApp
how to create users in LDAP using java?
Mysql List
Mysql List
how to install anaconda in ubuntu for all users
Save profile and image to mysql database, and view the image in another jsp page
ModuleNotFoundError: No module named 'odoo9-addon-product-pricelist-item-list-view'
Mysql List Tables
how to create users using IBM Tivoi API in jsp/servelet?
How to start learning MySQL?
Mysql Alter View
view data from database using drop down list
MySQL How to Topic
count the users?
how do i allow users to download a xls file in html?
view
Mysql List Tables
Version of openim>openim-users-manager dependency
Version of com.nervepoint>identity4j-mysql-users-connector dependency
How to Create Custom Picker View in iPhone
How to connect mysql with jsp
How to connect to MySQL in JSP?
Version of com.shipdream>view dependency
Version of openim>openim-users-manager-api dependency
Version of openim>openim-users-manager-impl dependency
PHP list box mysql
How alter table in MySQL?
How to connect to MySQL from command prompt?
Version of openim>openim-users-manager-ldap-impl dependency
MySQL Access Control
Version of com.monitorjbl>json-view dependency
Version of com.persist>sbt-view dependency
How to add "View more results" kind of functionality in my PHP based website?
How do I upgrade mysql?
ModuleNotFoundError: No module named 'users'
ModuleNotFoundError: No module named 'users'
How to get factorial in mysql
openim - openim-users-manager-api version 1.3 Maven dependency. How to use openim-users-manager-api version 1.3 in pom.xml?
PHP find online users

Ads