mysql_list_users

Overview

To list users, might be very simple task, but it is also essential for every DB, feel free to use the SQL below :)

[root@ag-se-tlcasdb2 log]# isql -v MySQL_APACDR01_APACDR
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> [root@ag-se-tlcasdb2 log]# mysql -uroot
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 51
Server version: 10.3.13-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>  SELECT user,host FROM mysql.user;
+---------+-----------------------------+
| user    | host                        |
+---------+-----------------------------+
| golden  | %                           |
| newuser | %                           |
| root    | 127.0.0.1                   |
| root    | ::1                         |
|         | ag-se-tlcasdb2.net.tain.com |
| golden  | ag-se-tlcasdb2.net.tain.com |
| root    | ag-se-tlcasdb2.net.tain.com |
|         | localhost                   |
| golden  | localhost                   |
| root    | localhost                   |
+---------+-----------------------------+

  • mysql_list_users.txt
  • Last modified: 2019/10/18 20:04
  • by 127.0.0.1