|
|
@ -323,7 +323,7 @@ def getPidFile(): |
|
|
|
return tmp.groups()[0].strip() |
|
|
|
return tmp.groups()[0].strip() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def binLog(): |
|
|
|
def binLog(version = ''): |
|
|
|
args = getArgs() |
|
|
|
args = getArgs() |
|
|
|
conf = getConf() |
|
|
|
conf = getConf() |
|
|
|
con = mw.readFile(conf) |
|
|
|
con = mw.readFile(conf) |
|
|
@ -334,7 +334,7 @@ def binLog(): |
|
|
|
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.execShell('sync') |
|
|
|
mw.execShell('sync') |
|
|
|
restart() |
|
|
|
restart(version) |
|
|
|
else: |
|
|
|
else: |
|
|
|
path = getDataDir() |
|
|
|
path = getDataDir() |
|
|
|
if 'status' in args: |
|
|
|
if 'status' in args: |
|
|
@ -348,7 +348,7 @@ def binLog(): |
|
|
|
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.execShell('sync') |
|
|
|
mw.execShell('sync') |
|
|
|
restart() |
|
|
|
restart(version) |
|
|
|
mw.execShell('rm -f ' + path + '/mysql-bin.*') |
|
|
|
mw.execShell('rm -f ' + path + '/mysql-bin.*') |
|
|
|
|
|
|
|
|
|
|
|
mw.writeFile(conf, con) |
|
|
|
mw.writeFile(conf, con) |
|
|
@ -3804,7 +3804,7 @@ if __name__ == "__main__": |
|
|
|
elif func == 'conf': |
|
|
|
elif func == 'conf': |
|
|
|
print(getConf()) |
|
|
|
print(getConf()) |
|
|
|
elif func == 'bin_log': |
|
|
|
elif func == 'bin_log': |
|
|
|
print(binLog()) |
|
|
|
print(binLog(version)) |
|
|
|
elif func == 'binlog_list': |
|
|
|
elif func == 'binlog_list': |
|
|
|
print(binLogList()) |
|
|
|
print(binLogList()) |
|
|
|
elif func == 'clean_bin_log': |
|
|
|
elif func == 'clean_bin_log': |
|
|
|