|
|
@ -406,6 +406,7 @@ def myOp(version, method): |
|
|
|
def my8cmd(version, method): |
|
|
|
def my8cmd(version, method): |
|
|
|
# mysql 8.0 and 5.7 |
|
|
|
# mysql 8.0 and 5.7 |
|
|
|
init_file = initDreplace(version) |
|
|
|
init_file = initDreplace(version) |
|
|
|
|
|
|
|
cmd = init_file + ' ' + method |
|
|
|
try: |
|
|
|
try: |
|
|
|
if version == '5.7': |
|
|
|
if version == '5.7': |
|
|
|
isInited = initMysql57Data() |
|
|
|
isInited = initMysql57Data() |
|
|
@ -413,10 +414,31 @@ def my8cmd(version, method): |
|
|
|
isInited = initMysql8Data() |
|
|
|
isInited = initMysql8Data() |
|
|
|
|
|
|
|
|
|
|
|
if not isInited: |
|
|
|
if not isInited: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if mw.isAppleSystem(): |
|
|
|
|
|
|
|
cmd_init_start = init_file + ' start' |
|
|
|
|
|
|
|
subprocess.Popen(cmd_init_start, stdout=subprocess.PIPE, shell=True, |
|
|
|
|
|
|
|
bufsize=4096, stderr=subprocess.PIPE) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
time.sleep(6) |
|
|
|
|
|
|
|
else: |
|
|
|
mw.execShell('systemctl start mysql') |
|
|
|
mw.execShell('systemctl start mysql') |
|
|
|
|
|
|
|
|
|
|
|
initMysql8Pwd() |
|
|
|
initMysql8Pwd() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if mw.isAppleSystem(): |
|
|
|
|
|
|
|
cmd_init_stop = init_file + ' stop' |
|
|
|
|
|
|
|
subprocess.Popen(cmd_init_stop, stdout=subprocess.PIPE, shell=True, |
|
|
|
|
|
|
|
bufsize=4096, stderr=subprocess.PIPE) |
|
|
|
|
|
|
|
time.sleep(3) |
|
|
|
|
|
|
|
else: |
|
|
|
mw.execShell('systemctl stop mysql') |
|
|
|
mw.execShell('systemctl stop mysql') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if mw.isAppleSystem(): |
|
|
|
|
|
|
|
sub = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True, |
|
|
|
|
|
|
|
bufsize=4096, stderr=subprocess.PIPE) |
|
|
|
|
|
|
|
sub.wait(5) |
|
|
|
|
|
|
|
else: |
|
|
|
mw.execShell('systemctl ' + method + ' mysql') |
|
|
|
mw.execShell('systemctl ' + method + ' mysql') |
|
|
|
return 'ok' |
|
|
|
return 'ok' |
|
|
|
except Exception as e: |
|
|
|
except Exception as e: |
|
|
|