From d054f7f9cd3029b690f1cdceaadfba4676939c7a Mon Sep 17 00:00:00 2001 From: dami Date: Wed, 2 Apr 2025 15:39:59 +0800 Subject: [PATCH 1/5] 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 2070075a7..d7489a99b 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -2404,7 +2404,12 @@ def getMasterRepSlaveUserCmd(version): port = getMyPort() db = pMysqlDb() - mstatus = db.query('show master status') + # SHOW REPLICA STATUS; + + cmd_status = "show master status" + if pk_version.parse(ver) > pk_version.parse("8.0"): + cmd_status = "show replica status" + mstatus = db.query(cmd_status) if len(mstatus) == 0: return mw.returnJson(False, '未开启!') From 536c76b000e3303832fd0d401e7931e6039dc1e9 Mon Sep 17 00:00:00 2001 From: dami Date: Wed, 2 Apr 2025 15:42:06 +0800 Subject: [PATCH 2/5] Update index.py --- plugins/mysql/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index d7489a99b..193c84693 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -2407,7 +2407,7 @@ def getMasterRepSlaveUserCmd(version): # SHOW REPLICA STATUS; cmd_status = "show master status" - if pk_version.parse(ver) > pk_version.parse("8.0"): + if pk_version.parse(version) > pk_version.parse("8.0"): cmd_status = "show replica status" mstatus = db.query(cmd_status) if len(mstatus) == 0: From 8920a1132cf6efeabbfbad8594b232946c58eef5 Mon Sep 17 00:00:00 2001 From: dami Date: Wed, 2 Apr 2025 16:07:40 +0800 Subject: [PATCH 3/5] Update index.py --- plugins/mysql/index.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index 193c84693..803d081f9 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -2404,8 +2404,6 @@ def getMasterRepSlaveUserCmd(version): port = getMyPort() db = pMysqlDb() - # SHOW REPLICA STATUS; - cmd_status = "show master status" if pk_version.parse(version) > pk_version.parse("8.0"): cmd_status = "show replica status" From cc27602454a2a4288ec5c02af9e5eedfe7d5f16e Mon Sep 17 00:00:00 2001 From: dami Date: Wed, 2 Apr 2025 16:18:44 +0800 Subject: [PATCH 4/5] Update index.py --- plugins/mysql/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index 803d081f9..5f5d3b044 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -2406,7 +2406,7 @@ def getMasterRepSlaveUserCmd(version): cmd_status = "show master status" if pk_version.parse(version) > pk_version.parse("8.0"): - cmd_status = "show replica status" + cmd_status = "SHOW BINARY LOG STATUS" mstatus = db.query(cmd_status) if len(mstatus) == 0: return mw.returnJson(False, '未开启!') From a35913ab789b76bb477d526dbfb640bbc49e29a1 Mon Sep 17 00:00:00 2001 From: dami Date: Wed, 2 Apr 2025 16:21:16 +0800 Subject: [PATCH 5/5] update --- plugins/mysql-community/index.py | 7 +++++-- plugins/mysql/index.py | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/mysql-community/index.py b/plugins/mysql-community/index.py index 989524778..885e2c8cb 100755 --- a/plugins/mysql-community/index.py +++ b/plugins/mysql-community/index.py @@ -2176,7 +2176,6 @@ def addMasterRepSlaveUser(version=''): def getMasterRepSlaveUserCmd(version): - args = getArgs() data = checkArgs(args, ['username', 'db']) if not data[0]: @@ -2199,7 +2198,11 @@ def getMasterRepSlaveUserCmd(version): port = getMyPort() db = pMysqlDb() - mstatus = db.query('show master status') + cmd_status = "show master status" + if pk_version.parse(version) > pk_version.parse("8.0"): + cmd_status = "SHOW BINARY LOG STATUS" + mstatus = db.query(cmd_status) + if len(mstatus) == 0: return mw.returnJson(False, '未开启!') diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index 5f5d3b044..b2bee65da 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -2381,7 +2381,6 @@ def addMasterRepSlaveUser(version=''): def getMasterRepSlaveUserCmd(version): - args = getArgs() data = checkArgs(args, ['username', 'db']) if not data[0]: