MySQL: Find Users in MySQL

  • Post author:
  • Post category:MySQL
  • Post comments:1 Comment
find users in mysql

In this guide, we will discuss how to find users in MySQL?

Question:Is there a query to run in MySQL that will return all Users created?

Answer: In MySQL, there is a system table called mysql.user. You can run a query against this system table that returns all of the Users that have been created in MySQL as well as information about these Users.

To retrieve all Users in MySQL, you can execute the following SQL statement:

SELECT User
FROM mysql.user;

The mysql.user table contains the following columns:

ColumnExplanation
HostHost for the user (ie: localhost, %, etc)
UserUser name (ie: root, adglob, etc)
PasswordPassword stored as a hashed value
Select_privY or N (indicating whether privilege has been assigned to user)
Insert_privY or N (indicating whether privilege has been assigned to user)
Update_privY or N (indicating whether privilege has been assigned to user)
Delete_privY or N (indicating whether privilege has been assigned to user)
Create_privY or N (indicating whether privilege has been assigned to user)
Drop_privY or N (indicating whether privilege has been assigned to user)
Reload_privY or N (indicating whether privilege has been assigned to user)
Shutdown_privY or N (indicating whether privilege has been assigned to user)
Process_privY or N (indicating whether privilege has been assigned to user)
File_privY or N (indicating whether privilege has been assigned to user)
Grant_privY or N (indicating whether privilege has been assigned to user)
References_privY or N (indicating whether privilege has been assigned to user)
Index_privY or N (indicating whether privilege has been assigned to user)
Alter_privY or N (indicating whether privilege has been assigned to user)
Show_db_privY or N (indicating whether privilege has been assigned to user)
Super_privY or N (indicating whether privilege has been assigned to user)
Create_tmp_table_privY or N (indicating whether privilege has been assigned to user)
Lock_tables_privY or N (indicating whether privilege has been assigned to user)
Execute_privY or N (indicating whether privilege has been assigned to user)
Repl_slave_privY or N (indicating whether privilege has been assigned to user)
Repl_client_privY or N (indicating whether privilege has been assigned to user)
Create_view_privY or N (indicating whether privilege has been assigned to user)
Show_view_privY or N (indicating whether privilege has been assigned to user)
Create_routine_privY or N (indicating whether privilege has been assigned to user)
Alter_routine_privY or N (indicating whether privilege has been assigned to user)
Create_user_privY or N (indicating whether privilege has been assigned to user)
Event_privY or N (indicating whether privilege has been assigned to user)
Trigger_privY or N (indicating whether privilege has been assigned to user)
Create_tablespaceY or N (indicating whether privilege has been assigned to user)
ssl_typeSecurity column
ssl_cipherSecurity column stored as a [BLOB]
x509_issuerSecurity column stored as a [BLOB]
x509_subjectSecurity column stored as a [BLOB]
max_questionsResource control column
max_updatesResource control column
max_connectionsResource control column
max_user_connectionsResource control column
pluginSecurity column
authentication_stringSecurity column

Next Topic : Click Here

This Post Has One Comment

Leave a Reply