How does mysql terminate the currently executing SQL statement? Below I will introduce to you how to implement it.
Operation steps:
show processlist;
Find out the statement you want to stop
Then find out the id of the statement you want to terminate
Under the systemmysqladmin -uroot -ppassword kill will
clear the ID to be killed.
MySQL query statement execution process:
1. The client sends a query to the server;
2. The server first checks the query cache. If the cache is hit, the result stored in the cache is returned immediately. Otherwise, enter the next stage;
3. The server performs SQL parsing and preprocessing, and then the optimizer generates the corresponding execution plan;
4. MySQL executes the execution plan based on the execution plan generated by the optimizer. Call the API of the storage engine to execute the query;
5. Return the results to the client.
Related learning recommendations:mysql tutorial
The above is the detailed content of How to end a statement in mysql?. For more information, please follow other related articles on the PHP Chinese website!