How to List MySQL Users
Assalamu’alaykum warahmatullahi wabarakatuh,
When using MySQL as a backend database, sometimes we need to list the MySQL users to see whom have access to the database server, heres how :
Login to MySQL Database Command Line Interfaces
[sourcecode language=”bash”]
mysql -u mysql-user -p mysql-user-password
[/sourcecode]
Then run this command
[sourcecode language=”bash”]
select user from mysql.user ;
[/sourcecode]
Sometimes we need to know from which machine the user have access, so run this command
[sourcecode language=”bash”]
select host,user from mysql.user ;
[/sourcecode]
Here’s the example of the result
[sourcecode language=”bash”]
+—————-+——————+
| host | user |
+—————-+——————+
| 10.100.150.140 | wp-home-edu |
| 10.100.150.140 | wp-home-org |
| 10.100.150.142 | wp-home-tv |
| 10.100.150.145 | wp-home-sd |
| 127.0.0.1 | root |
| localhost | debian-sys-maint |
| localhost | root |
| walldb | root |
+—————-+——————+
[/sourcecode]
Happy Administer System !
- How to Reset the MySQL Root Password on Unix Systems
- Just a Note : Reconfigure Exim4 MTA in Debian
- How to LSBize and init Script in Debian