I need to capture a value of "seconds_behind_master" column.
SHOW SLAVE STATUS;
How to achieve it ?
I need to capture a value of "seconds_behind_master" column.
SHOW SLAVE STATUS;
How to achieve it ?
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)
SECONDS=$(mysql -uuser -ppass -Pport -e"show slave status\G" grep Seconds_Behind_Master | awk '{print $2}')