MySQL定时检查MySQL的表锁

crontab-mysqlLock-go

  • 安装GOLANG运行环境
如果没有安装请自行百度或google吧,这里不再叙述了 ... sorry 
  • github clone 项目
git clone git@github.com:verytalk/crontab-mysqlLock-go.git
  • 定时检查MySQL的表锁
这个项目只需要简单地配置即可定时检查MySQL的表锁
可以帮助DBA分析是什么原因导致的表产生的事务锁
  • 如何配置 ?

查看文件 test.yaml

crontab:
  period : "*/10 * * * * *"
mysql:
  user : root
  password :
  host : 127.0.0.1
  port : 3306
  name : mysql
logfile:
  filename: test.log

  • 如何执行 ?
GO111MODULE=on go run main.go -config test.yaml

or

go build main.go
./main -config test.yaml
  • 如何分析 ?
查看文件 test.log

这个文件名可以在 test.yaml 中配置
posted @ 2020-04-23 16:34  jasondayee  阅读(150)  评论(0编辑  收藏  举报