mysql kill query pid,kill-mysql-query以交互方式显示MySQL数据库中长时间运行的查询,并提供逐个关闭它们的选项...

kill-mysql-query

_____ ____

/ \ | o |

| |/ ___\|

|_________/

|_|_| |_|_|

kill-mysql-query interactively shows long running queries in MySQL database and provides option to kill them one by one.

👉 Great for firefighting situations

🔥

🚨

🚒

It can connect to MySQL server as configured, can use SSH Tunnel if necessary, and let you decide which query to kill. By default queries running for more than 10 seconds will be marked as long running queries, but it can be configured.

fd5b8ea34721bdb1a82b224473266009.png

Installation

Download binary from release tab.

Usage

kill-mysql-query [config.toml]:

Checks for long running queries in the configured server.

If no file is given, it tries to read from config.toml

in the current directory.

Other commands:

generate [config.toml]:

Generates a new empty configuration file

init:

Alias for generate

help, --help, -h:

Shows this message

Configuration

Run kill-mysql-query init to generate an empty configuration file.

[MySQL]

mysql_host = ""

mysql_port = 3306

mysql_username = ""

mysql_password = ""

# hosted_in_aws_rds: Optional.

#

# Uses `CALL mysql.rds_kill()` instead of `kill` command.

# Useful in RDS databases or replica where

# `mysql_username` may not have privilege to use `kill`

hosted_in_aws_rds = false

# db: Optional.

#

# If provided, filter out long running

# queries from other databases

db = ""

[ssh_tunnel]

use_ssh_tunnel = false

ssh_host = ""

ssh_port = 22

ssh_username = ""

ssh_password = ""

# ssh_private_key takes priority over ssh_password

# if both are provided

ssh_private_key = ""

# ssh_key_passphrase: Optional.

ssh_key_passphrase = ""

[long_running_query]

# Default is 10 seconds.

# `kill-mysql-query` will only list running queries

# those are being executed for more than or equal to

# this value.

timeout_second = 10

FAQ

How do I simulate a long running query to test kill-mysql-query?

This stackoverflow answer may come in handy: https://stackoverflow.com/a/3892443/761555

select benchmark(9999999999, md5('when will it end?'));

License

MIT

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值