diff --git a/class/core/plugins_api.py b/class/core/plugins_api.py index e04b16ad1..5be9954c8 100755 --- a/class/core/plugins_api.py +++ b/class/core/plugins_api.py @@ -7,9 +7,14 @@ import public import re import json +import sys +reload(sys) +sys.setdefaultencoding('utf8') + import threading import multiprocessing + from flask import request diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index b4da93282..dade137d9 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -186,13 +186,16 @@ def status(): def start(): - path = os.path.dirname(os.getcwd()) - cmd = path + "/redis/bin/redis-server" - cmd = cmd + " " + path + "/redis/redis.conf" + initMysql = getServerDir() + '/scripts/mysql_install_db ' + '--basedir=' + \ + getServerDir() + ' --datadir=' + getServerDir() + '/bin/mysql/data' + return initMysql + + cmd = getServerDir() + '/bin/mysqld_safe ' + getServerDir() + \ + '/conf/my.cnf ' + '--user=mysql&' data = public.execShell(cmd) if data[0] == '': - return 'ok' - return 'fail' + return 'stop' + return data[0] def stop():