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