如何从SHOW SLAVE STATUS捕获列值 [英] How to capture a column values form SHOW SLAVE STATUS
本文介绍了如何从SHOW SLAVE STATUS捕获列值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要捕获"seconds_behind_master"列的值.
I need to capture a value of "seconds_behind_master" column.
显示从属状态; </p>
SHOW SLAVE STATUS;
如何实现?
推荐答案
在Shell脚本中或在Linux上的命令行中,您可以:
In a shell script or on the command line on Linux you could:
SECONDS_BEHIND=$(mysql -usome_user -psome_pass -e "show slave status" -E | grep "Seconds_Behind_Master:" | cut -d: -f2)
这篇关于如何从SHOW SLAVE STATUS捕获列值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文