
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
How to get a list of MySQL user accounts?
To get the list of MySQL user accounts, we can use “SELECT USER”.
The following is the query to display the list.
SELECT User FROM mysql.user;
Here is the output.
+------------------+ | User | +------------------+ | John | | Mac | | Manish | | mysql.infoschema | | mysql.session | | mysql.sys | | root | | am | +------------------+ 8 rows in set (0.00 sec)
The above output displays all the user accounts. Here is the query that gives corressponding host.
mysql> select User,Host from mysql.user;
The following is the output.
+------------------+-----------+ | User | Host | +------------------+-----------+ | John | % | | Mac | % | | Manish | % | | mysql.infoschema | % | | mysql.session | % | | mysql.sys | % | | root | % | | am | localhost | +------------------+-----------+ 8 rows in set (0.00 sec)
- Related Articles
- How to get a list of MySQL user hosts?
- How to get the disabled local user accounts using PowerShell?
- How can we create user accounts in MySQL database server?
- How to Create Multiple User Accounts in Linux?
- How to find the locked local user accounts using PowerShell?
- How to get a list of MySQL views?
- How to get a list of MySQL indexes?
- Create manage user accounts using utility netplwiz
- Python Get a list as input from user
- Best option for locking bulk user accounts in SAP
- Get a list of Constraints from MySQL Database?
- Get a list of MySQL databases and version?
- How to get the list of tables in default MySQL database?
- How to prepare accounts receivable and accounts payable ledger postings?
- How to update User Logged in Time for a specific user in MySQL?

Advertisements