| Showing entries 1 to 6 |
InSELECT,ORDER BYandGROUP BYloops, the flag is checked after reading a block of rows. If the kill flag is set, the statement is aborted.
The MySQL KILL command as the name suggests kills queries that are running.
After identifying the Id using the SHOW PROCESSLIST command, the User of the connection/thread or a database user with SUPER privileges can execute KILL [id]; to remove the connection/thread.
However, there is an ability to kill just the query that is being executed rather the entire connection. The default when not specified is to kill the connection, however you can optional specify the CONNECTION or QUERY keywords.
For example, below is an interactive test.
Thread 1:
mysql> select sleep(10);
Thread 2:
mysql> show processlist; +----+------+-----------+------+---------+------+-----------+------------------+ | Id | User | Host | db | Command | Time | State | Info[Read more...]
It”s not the most common task in the world, but you might want to view processes from a particular user and once in a while you might even need to kill processes from a single user, be it during an attack or because you simply got a bug in an application bombarding your db server with connections!
Here is a small stored procedure which does exactly that!
call process_list("show","username","hostname");– shows all processes owned by username@hostname
call process_list("kill","username","hostname");– kills all processes owned by username@hostname
The code for this stored procedure can be found below. If you have any comments / suggestions feel free to comment below.
[Read more...]Few days ago I worked on some customer’s server and there was a problem - their nfs server went down and we were forced to change some settings on their FC4 clients to prevent shares from dieing because of kernel bug. But when we’ve changed settings in /etc/fstab there was one more step before task was completed - we need to remount this share (I mean unmount/mount). But how to perform this operation if there are some processes in D (non-interruptible sleep) waiting for dead share and prevent it from unmounting? They wait because of hard option on the share and lack of intr option and any unmount request would produce a following results:
streaming01:~# umount /storages/2So, here is a list of steps you need to do to be able to remount your share.
[Read more...]| Showing entries 1 to 6 |