

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to get a list of MySQL user hosts?
Firstly, get a list of MySQL user accounts, using MySQL.user table. You can use select user column from MySQL.user table to get a list of MySQL user accounts.
The query is as follows −
mysql> select user from MySQL.user;
The following output displays all the users −
+------------------+ | user | +------------------+ | Manish | | mysql.infoschema | | mysql.session | | mysql.sys | | root | | am | +------------------+ 6 rows in set (0.06 sec)
Now you can get a list of host from MySQL.user table. There is host column present in MySQL.user table.
The query is as follows −
mysql> select user,host from MySQL.user;
The following output displays users and host −
+------------------+-----------+ | user | host | +------------------+-----------+ | Manish | % | | mysql.infoschema | % | | mysql.session | % | | mysql.sys | % | | root | % | | am | localhost | +------------------+-----------+ 6 rows in set (0.00 sec)
- Related Questions & Answers
- How to get a list of MySQL user accounts?
- How to get a list of MySQL views?
- How to get a list of MySQL indexes?
- Python Get a list as input from user
- Open MySQL root access from all hosts?
- Get a list of Constraints from MySQL Database?
- Get a list of MySQL databases and version?
- Get a list of Foreign Key constraints in MySQL
- How to get the list of tables in default MySQL database?
- How to get a list of installed android Applications?
- How to update User Logged in Time for a specific user in MySQL?
- Grant all privileges of a database to a MySQL user?
- How to get current user is system user or not in android?
- How can we grant privileges to a MySQL user?
- How to display grant defined for a MySQL user?
Advertisements