MySQL批量殺程式
OS: CentOS 6.3
DB:5.5.14
mysql> show processlist;
+----+------+-----------+--------------------+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------+--------------------+---------+------+-------+------------------+
| 37 | root | localhost | information_schema | Query | 0 | NULL | show processlist |
| 38 | root | localhost | NULL | Sleep | 559 | | NULL |
+----+------+-----------+--------------------+---------+------+-------+------------------+
mysql> kill 40;
1 row in set (0.00 sec)
mysql> use information_schema
mysql> select id from processlist;
+----+
| id |
+----+
| 40 |
+----+
1 row in set (0.00 sec)
mysql> select concat('kill ',id,';') from information_schema.processlist where user='root' into outfile '/export/yoon.txt';
Query OK, 1 row affected (0.09 sec)
[root@db01 export]# more yoon.txt
kill 40;
批量刪除會話:
mysql> source /export/yoon.txt
DB:5.5.14
mysql> show processlist;
+----+------+-----------+--------------------+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------+--------------------+---------+------+-------+------------------+
| 37 | root | localhost | information_schema | Query | 0 | NULL | show processlist |
| 38 | root | localhost | NULL | Sleep | 559 | | NULL |
+----+------+-----------+--------------------+---------+------+-------+------------------+
mysql> kill 40;
1 row in set (0.00 sec)
mysql> use information_schema
mysql> select id from processlist;
+----+
| id |
+----+
| 40 |
+----+
1 row in set (0.00 sec)
mysql> select concat('kill ',id,';') from information_schema.processlist where user='root' into outfile '/export/yoon.txt';
Query OK, 1 row affected (0.09 sec)
[root@db01 export]# more yoon.txt
kill 40;
批量刪除會話:
mysql> source /export/yoon.txt
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28939273/viewspace-1258682/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 如何批量殺死當前的MySQL程式MySql
- linux批量殺掉程式linux批量殺掉程式Linux
- MySQL 批量殺mysql執行緒MySql執行緒
- Mysql殺程式MySql
- 利用pgrep批量kill殺死多個mysqld程式MySql
- 批量kill mysql processlist程式MySql
- linux kill -9 的記錄,批量殺程式Linux
- oracle生成批量殺掉active程式的sqlOracleSQL
- 批量殺死MySQL連線的幾種方法詳解MySql
- linux下如何批量殺JAVA程式或某個程式方法LinuxJava
- 批量kill殺死某些會話session的plsql會話SessionSQL
- MySQL_殺mysql執行緒MySql執行緒
- mysql連結很多,批量刪除異常程式processlistMySql
- MySQL批量管理系統MySql
- Mybatis批量插入Oracle、MySQLMyBatisOracleMySql
- oracle殺程式Oracle
- MySQL使用Batch批量處理MySqlBAT
- mysql批量替換指定字串MySql字串
- 檢視MySql資料庫鎖,並殺死對應程式MySql資料庫
- 程式設計方式實現MySQL批量匯入sql檔案程式設計MySql
- 批量關閉程式
- Mysql批量大資料獲取MySql大資料
- MySQL批量更新死鎖案例分析MySql
- mysql型別批量替換工具MySql型別
- PHP執行批量mysql語句PHPMySql
- MySQL批量刪除指定字首表MySql
- puppet之mysql批量安裝案例MySql
- PostgreSQL秒殺4種方法-增加批量流式加減庫存方法SQL
- 【MySQL】批量刪除mysql中資料庫中的表MySql資料庫
- 殺死殭屍程式
- 批次殺程式指令碼指令碼
- 批量kill python 程式Python
- 極客漫畫:誰殺死了 MySQLMySql
- win系統下git程式碼批量克隆,批量更新Git
- PHP配上MySQL實現批量更新插入PHPMySql
- MySQL:JDBC批量插入資料的效率MySqlJDBC
- MySQL 批量匯入資料優化MySql優化
- php中對MYSQL操作之批量執行,與獲取批量結果PHPMySql