Skip to content

Simple PHP Script to List & Kill Current Mysql Process

here we go




mysql_unbuffered_query('kill '.$_GET['kill']);

echo '<h1>Process Id : '.$_GET['kill'].' has been terminated</h1>';


$sql = 'show full processlist';
		echo '
		table {
			margin: 1em 20px 0 0; 
			width: calc(100% - 40px);
			margin: 20px;
		td, thead th {
			background: #fff;
		<table  border="1" cellspacing="1" cellpadding="3">
			  <th title="">No</th>
			  <th title="">Id</th>
			  <th title="">User</th>
			  <th title="">Host</th>
			  <th title="">db</th>
			  <th title="">Command</th>
			  <th title="">Time</th>
			  <th title="">State</th>
			  <th title="">Info</th>
		$q = mysql_query("SHOW FULL PROCESSLIST");
		$no = 1;

		while ($rs = mysql_fetch_assoc($q)) {
		echo '    
			  <td><a href="?kill='.$rs['Id'].'">'.$rs['Id'].'<?php ?></td>
		echo '



Comments are closed.