Update index.py

pull/109/head
midoks 6 years ago
parent db77946a34
commit af9886d41b
  1. 11
      plugins/mysql/index.py

@ -146,11 +146,20 @@ def getShowLogFile():
return tmp.groups()[0].strip() return tmp.groups()[0].strip()
def pGetDbUser():
if public.isAppleSystem():
user = public.execShell(
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
return user
return 'mysql'
def initMysqlData(): def initMysqlData():
datadir = getDataDir() datadir = getDataDir()
if not os.path.exists(datadir + '/mysql'): if not os.path.exists(datadir + '/mysql'):
serverdir = getServerDir() serverdir = getServerDir()
cmd = 'cd ' + serverdir + ' && ./scripts/mysql_install_db --user=midoks --basedir=' + \ user = pGetDbUser()
cmd = 'cd ' + serverdir + ' && ./scripts/mysql_install_db --user=' + user + ' --basedir=' + \
serverdir + ' --ldata=' + datadir serverdir + ' --ldata=' + datadir
public.execShell(cmd) public.execShell(cmd)
return 0 return 0

Loading…
Cancel
Save