From f78296c1b08c1379eeabab783814b75bf5dc59a8 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 10 Jun 2024 17:05:38 +0800 Subject: [PATCH] Update index.py --- plugins/mysql/index.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index 0a323739a..6904a3ab9 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -2196,6 +2196,11 @@ def setDbSlave(version): def getMasterStatus(version=''): + query_status_cmd = 'show slave status' + mdb8 = ['8.0','8.1','8.2','8.3','8.4'] + if mw.inArray(mdb8, version): + query_status_cmd = 'show replica status' + try: if status(version) == 'stop': return mw.returnJson(False, 'MySQL未启动,或正在启动中...!', []) @@ -2214,7 +2219,7 @@ def getMasterStatus(version=''): data['slave_status'] = False db = pMysqlDb() - dlist = db.query('show slave status') + dlist = db.query(query_status_cmd) for v in dlist: if v["Slave_IO_Running"] == 'Yes' or v["Slave_SQL_Running"] == 'Yes':