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'] + \