How to kill all mysql process

Use the below query to get all the process

SELECT CONCAT('KILL ',id,';') AS run_this FROM information_schema.processlist WHERE user='your database username'

Here replace ‘your database username’ with your actual database username, for which you have to kill the process.

Once you run the query, it will show list of process for that mentioned user. Now export the data to any file (for example text file). When you open this file, you can able to view all process with MYSQL kill command, separated by each line.

You can copy this and run on your MYSQL to kill all the process in one shot.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *