mysql> SHOW VARIABLES LIKE "secure_file_priv";
+------------------+-----------------------+
| Variable_name | Value |
+------------------+-----------------------+
| secure_file_priv | /var/lib/mysql-files/ |
+------------------+-----------------------+
1 row in set (0.00 sec)
mysql> Bye
mysql -e "SELECT CONCAT('KILL ',ID,';') FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'user' AND COMMAND = 'Query' AND TIME > 100 INTO OUTFILE '/var/lib/mysql-files/kill_list.txt';" && mysql -e "source /var/lib/mysql-files/kill_list.txt" && rm -rf /var/lib/mysql-files/kill_list.txt