mariadbHow to list users in Mariadb?
To list users in MariaDB, you can use the SELECT
statement with the USER
table.
SELECT User, Host FROM mysql.user;
This will output a list of users and their associated hosts.
Code explanation
SELECT
- This is a SQL statement used to select data from a database.USER
- This is the table in themysql
database that contains user information.User, Host
- These are the columns from theUSER
table that will be selected.
Helpful links
More of Mariadb
- What type to use for a year in Mariadb?
- How to work with XML in Mariadb?
- How to use xtrabackup in Mariadb?
- How to check version of Mariadb?
- How to use UUID in Mariadb?
- How to change wait_timeout in Mariadb?
- How to use the WITH clause in Mariadb?
- Working with JSON in Mariadb
- How to list available engines in Mariadb?
- How to backup all databases in Mariadb?
See more codes...