How can I view the user status in MySQL?
In MySQL, you can use the following command to view the status of a user:
- Open the command line terminal and type in the following command to log in to the MySQL server:
mysql -u 用户名 -p
Please replace “username” with the username of the user whose status you want to view.
- Once logged in successfully, you can use the following command to check the current user’s connection status:
SHOW PROCESSLIST;
This will display the current information of all users connected to the server, including connection ID, user, host, database, and status.
- To view the status of a specific user, you can use the following command.
SHOW PROCESSLIST
WHERE User = '用户名';
Please replace “username” with the username of the user whose status you want to view.
This way, you can now check the status of a specific user in MySQL.