for mac debug

pull/109/head
midoks 3 years ago
parent f1ec5e1b97
commit dd630f3eed
  1. 28
      plugins/mysql/index.py

@ -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,11 +414,32 @@ def my8cmd(version, method):
isInited = initMysql8Data() isInited = initMysql8Data()
if not isInited: if not isInited:
mw.execShell('systemctl start mysql')
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')
initMysql8Pwd() initMysql8Pwd()
mw.execShell('systemctl stop mysql')
mw.execShell('systemctl ' + method + ' mysql') 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')
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')
return 'ok' return 'ok'
except Exception as e: except Exception as e:
return str(e) return str(e)

Loading…
Cancel
Save