Question: How to kill process using sys_exec().
I am trying to execute shell script using the sys_exec().
my shell script contains
killall process_name 
when i execute above script, at that time it is not calling
killall process_name 
command. But it executes other operations like `
sys_exec(touch filename.txt);`
How to execute above shellscript?
If you have MySQL 5.1 where the processlist is in the INFORMATION_SCHEMA, you can do this to generate the KILL QUERY commands in bulk from within the mysql client:
SELECT GROUP_CONCAT(CONCAT('KILL QUERY ',id,';') SEPARATOR ' ') KillQuery
FROM information_schema.processlist WHERE user<>'system user'\G
You might want to take a look at these links
http://dbadiaries.com/how-to-kill-all-mysql-processes-for-a-specific-user https://dba.stackexchange.com/questions/2634/kill-all-queries-mysql
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With