Cli util that just print to stdout short status of mysql slave instance
- Seconds behind master
- Status
- Error (if has)
Download from releases
or run
go get github.com/bald2b/mysql-slave-status
Minimal requirements:
- golang 1.11+
- -h mysql host:port (default 127.0.0.1:3306)
- -u mysql user name (default root)
- -p mysql password, ask if empty
- -r repeat every N seconds, no repeat if 0
- -s print only seconds behind master value
mysql-slave-status -h 172.17.0.1:3307 -u slave_user -p
Output:
Enter password: ******
Seconds behind master: 0
State: Slave has read all relay log; waiting for more updates
mysql-slave-status -h 172.17.0.1:3307 -u slave_user -p passw0rd -s
Output:
341