From a2ee7c9092fd342ef07035b4fcf40f88c3fe8be0 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 4 Feb 2021 19:18:29 +0800 Subject: [PATCH] Update index.py --- plugins/mysql/index.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index 25d3ad83c..a953af4d6 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -1396,6 +1396,9 @@ def getMasterRepSlaveUserCmd(version): db = pMysqlDb() tmp = db.query('show master status') + if len(tmp) == 0: + return mw.returnJson(False, '未开启!') + sql = "CHANGE MASTER TO MASTER_HOST='" + ip + "', MASTER_PORT=" + port + ", MASTER_USER='" + \ clist[0]['username'] + "', MASTER_PASSWORD='" + \ clist[0]['password'] + \