ablog

不器用で落着きのない技術者のメモ

Aurora MySQL でセッションを kill する方法

  • スレッド ID を確認する。
    • Id 列がスレッドID
mysql> SHOW FULL PROCESSLIST;
+----+----------+---------------------+------+---------+------+-------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Id | User     | Host                | db   | Command | Time | State       | Info                                                                                                                                                                                               |
+----+----------+---------------------+------+---------+------+-------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|  2 | rdsadmin | localhost           | NULL | Sleep   |    1 | cleaning up | NULL                                                                                                                                                                                               |
|  3 | rdsadmin | localhost           | NULL | Sleep   |    0 | cleaning up | NULL                                                                                                                                                                                               |
|  4 | rdsadmin | localhost           | NULL | Sleep   |    5 | cleaning up | NULL                                                                                                                                                                                               |
|  6 | rdsadmin | localhost           | NULL | Sleep   |    1 | cleaning up | NULL                                                                                                                                                                                               |
| 10 | rdsadmin | localhost           | NULL | Sleep   |  226 | cleaning up | NULL                                                                                                                                                                                               |
| 14 | awsuser  | 172.**.**.148:46994 | db1  | Query   |  154 | executing   | LOAD DATA FROM S3 MANIFEST 's3-ap-northeast-1://aws-foo-files/sbtest100m/sbtest100m.manifest' INTO TABLE sbtest100m_s3_load FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (id, k, c, pad) |
| 15 | awsuser  | 172.**.**.148:47050 | NULL | Query   |    0 | starting    | SHOW FULL PROCESSLIST                                                                                                                                                                              |
+----+----------+---------------------+------+---------+------+-------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
7 rows in set (0.00 sec)
  • セッションを kill する
mysql> CALL mysql.rds_kill(14);