如何使用选择查询了解 MySQL 复制状态? [英] How to know MySQL replication status using a select query?
本文介绍了如何使用选择查询了解 MySQL 复制状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以从任何系统数据库表中获取复制状态?
Is it possible to get replication status from any system database table?
使用它我可以确定复制是向上还是向下.
Using which I can identify whether the replication is up or down.
我需要知道系统表中的 SLAVE_IO_RUNNING
和 SLAVE_SQL_RUNNING = YES
是否存在.
I need to to know whether the SLAVE_IO_RUNNING
and SLAVE_SQL_RUNNING = YES
from a system table.
推荐答案
这是我根据 Manasi 的最佳答案使用的陈述.
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';
这篇关于如何使用选择查询了解 MySQL 复制状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文