List users in MariaDB database

Query below returns list of users in current database.

Query

select host,
       user as username,
       password,
       password_expired
from mysql.user
order by user;

Columns

  • host - user host limitation (% means all hosts)
  • username - user name
  • password - hashed password encoded with plugin
  • password_expired - indicate if password is expired

Rows

  • One row represents one user in the database
  • Scope of rows: all users in the database
  • Ordered by user name

Sample results

sample results

MySQL Workbench

You can vew database users using MySQL Workbench. In the Navigator select Users and Privileges position (1). List of users will appear in new tab (2).

ssms

Comments are only visible when the visitor has consented to statistics cookies. To see and add comments please accept statistics cookies.
0
There are no comments. Click here to write the first comment.