Created
March 19, 2019 09:08
-
-
Save m0veax/54c64225df8279d0dab9b651693537af to your computer and use it in GitHub Desktop.
Small improved MySQL Process Monitor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta http-equiv="refresh" content="10"> | |
</head> | |
<body> | |
<?php | |
ini_set('display_errors',1); | |
error_reporting(E_ALL); | |
$PDO = new PDO("mysql:host=hostname;charset=utf8", "user", "password"); | |
?> | |
<button onclick="window.stop();">Prevent Reload</button> | |
<br/><br/> | |
<table border="1"> | |
<tr> | |
<td>ID</td> | |
<td>USER</td> | |
<td>HOST</td> | |
<td>DB</td> | |
<td>COMMAND</td> | |
<td>TIME</td> | |
<td>STATE</td> | |
<td>INFO</td> | |
</tr> | |
<?php | |
foreach($PDO->query('SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST order by USER, TIME') as $row) { | |
?> | |
<tr> | |
<td><?=$row['ID']?></td> | |
<td><?=$row['USER']?></td> | |
<td><?=$row['HOST']?></td> | |
<td><?=$row['DB']?></td> | |
<td><?=$row['COMMAND']?></td> | |
<td><?=$row['TIME']?></td> | |
<td><?=$row['STATE']?></td> | |
<td><?=$row['INFO']?></td> | |
</tr> | |
<?php | |
} | |
?> | |
</table> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment