如果没有安装请自行百度或google吧,这里不再叙述了 ... sorry
git clone git@github.com:verytalk/crontab-mysqlLock-go.git
这个项目只需要简单地配置即可定时检查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 中配置
原文:https://www.cnblogs.com/jasondayee/p/12761792.html