diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index eb51e9c84..98960a5ad 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -110,9 +110,15 @@ def getInitdTpl(version=''): def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) - content = content.replace('{$SERVER_PATH}', service_path) - content = content.replace('{$SERVER_APP_PATH}', service_path + '/mysql') + if content.find('{$ROOT_PATH}') != -1: + content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + + if content.find('{$SERVER_PATH}') != -1: + content = content.replace('{$SERVER_PATH}', service_path) + + if content.find('{$SERVER_APP_PATH}') != -1: + content = content.replace( + '{$SERVER_APP_PATH}', service_path + '/mysql') return content @@ -323,7 +329,8 @@ def initMysql57Data(): user = pGetDbUser() cmd = 'cd ' + serverdir + ' && ./bin/mysqld --defaults-file=' + myconf + \ ' --initialize-insecure --explicit_defaults_for_timestamp' - mw.execShell(cmd) + # print(mw.execShell(cmd)) + return False return True @@ -357,19 +364,6 @@ def initMysqlPwd(): return True -def mysql8IsInitedPasswd(): - - serverdir = getServerDir() - pass_cmd = "cat " + serverdir + \ - "/data/error.log | grep root@localhost | awk -F 'root@localhost:' '{print $2}'" - passdata = mw.execShell(pass_cmd) - password = passdata[0].strip() - - if len(password) == 0: - return True - return False - - def initMysql8Pwd(): time.sleep(2)