mysql replication status using a select query

MySQL DBA picture MySQL DBA · Aug 10, 2011 · Viewed 37.6k times · Source

Is it possible to get replication status from any system database table. using which i can identify whether the replication is up or down.

I need to to know whether the SLAVE_IO_RUNNING and SLAVE_SQL_RUNNING = YES from a system table?

Manasi

Answer

hslakhan picture hslakhan · Jul 27, 2016

This is the statement that I have used based on Manasi's top answer.

SELECT variable_value 
FROM information_schema.global_status 
WHERE variable_name='SLAVE_RUNNING';