Home >Database >Mysql Tutorial >How to query all users in mysql

How to query all users in mysql

王林
王林Original
2020-10-13 14:22:4712562browse

How to query all users in mysql: execute [SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql .user;] to view.

How to query all users in mysql

View all users in the MYSQL database

(Recommended tutorial: mysql video tutorial)

mysql> SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;

View the permissions of a specific user in the database

mysql> show grants for 'cactiuser'@'%';
mysql> select * from mysql.user where user='cactiuser' \G

To view the user table structure, specific items required can be queried in conjunction with the table structure

mysql> desc mysql.user;

Related recommendations: mysql tutorial

The above is the detailed content of How to query all users in mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn