How to query all users in mysql: execute [SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql .user;] to view.
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!