mysql is consuming CPU resources. How to view the connection currently executing sql statements?
Published: 2021-08-02
When mysql uses a relatively large amount of resources, you need to log in and view the executed sql for analysis. The syntax is the same on windows and linux.
mysql -uroot -p #Press Enter
Enter the root password, then enter
show full processlist;

When database query execution is relatively slow, you can use this method to list the executed sql statements, then use the explain command to check statement execution efficiency. Mainly look at the data volume and execution efficiency, and determine whether to create an index for cname based on the actual situation.

phpmyadmin can also view the currently executing statement connections. As shown in the figure, after logging in, click “Status”-“Processes”.

