For all operations you still need access to the MySQL console, at least via SSH. Moreover, the MySQL server must have free "connections" available, i.e. this method won't work if the server is stuck because all connections are used up (a DDoS attack, or a bug in the site's or software's code that keeps flooding the server with requests).
Process listSo, if we're connected via mysql:
$ mysql -u username -p
Password:
To see the current connections:
> SHOW PROCESSLIST;
If you don't use the FULL parameter, only the first 100 characters of the query will be shown. If you need to see queries in full - use:
> SHOW FULL PROCESSLIST;
This command outputs a list of processes with information about what each process is doing.
The same thing - but via mysqladmin:
$ mysqladmin -u username -p processlist
Killing a processTo "kill" a specific process - first look up its ID from PROCESSLIST, then run the command:
> KILL <ID>
Or via mysqladmin:
$ mysqladmin -u username -p kill <ID>
Where instead of <ID> you substitute the actual process ID.
Comments