Update index.py

pull/713/head
dami 2 months ago
parent 6fe6f55df8
commit 89d13494c0
  1. 6
      plugins/mysql-community/index.py

@ -288,12 +288,13 @@ def binLog(version=''):
args = getArgs()
conf = getConf()
con = mw.readFile(conf)
if con.find('#log-bin=mysql-bin') != -1:
if 'status' in args:
return mw.returnJson(False, '0')
con = con.replace('#log-bin=mysql-bin', 'log-bin=mysql-bin')
con = con.replace('#binlog_format=mixed', 'binlog_format=mixed')
mw.writeFile(conf, con)
mw.execShell('sync')
restart(version)
else:
@ -308,11 +309,10 @@ def binLog(version=''):
return mw.returnJson(True, dsize)
con = con.replace('log-bin=mysql-bin', '#log-bin=mysql-bin')
con = con.replace('binlog_format=mixed', '#binlog_format=mixed')
mw.writeFile(conf, con)
mw.execShell('sync')
restart(version)
mw.execShell('rm -f ' + path + '/mysql-bin.*')
mw.writeFile(conf, con)
return mw.returnJson(True, '设置成功!')

Loading…
Cancel
Save