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

How to query all users in mysql

王林
Release: 2020-10-13 14:22:47
Original
12559 people have browsed it

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;
Copy after login

View the permissions of a specific user in the database

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

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

mysql> desc mysql.user;
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template