Friday, September 04, 2009

How to Kill a MySQL Process

Sometimes if your mysql process starts to run at 100% cpu, you need determine which process is taking up the load. In order to do so, use the mysql command line tool and type the command:


show processlist;

From here you can see which query is still running on the mysql instance. The first column shows you the process id. Type the following command to kill it:

kill 12345;

Where 12345 is the process id.