-
Notifications
You must be signed in to change notification settings - Fork 113
/
mysql_users.sql
40 lines (38 loc) · 957 Bytes
/
mysql_users.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
--
-- Author: Hari Sekhon
-- Date: 2020-08-06 09:51:00 +0100 (Thu, 06 Aug 2020)
--
-- vim:ts=4:sts=4:sw=4:et:filetype=sql
--
-- https://github.com/HariSekhon/SQL-scripts
--
-- License: see accompanying Hari Sekhon LICENSE file
--
-- If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
--
-- https://www.linkedin.com/in/HariSekhon
--
-- List MySQL users ordered by host, user similar to auth resolution
--
-- Requires MySQL 8.0+
-- Requires MariaDB N/A
--
-- Tested on MySQL 8.0
--
-- some fields don't exist on MySQL < 8.0 and MariaDB 10.0 - 10.5, must use mysql_users_pre8.sql instead
SELECT
host,
user,
max_connections,
max_user_connections,
password_expired,
password_last_changed,
password_lifetime,
account_locked,
password_reuse_time,
password_require_current
FROM
mysql.user
ORDER BY
host,
user;