mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-20 08:25:50 +08:00
update
This commit is contained in:
@@ -755,6 +755,11 @@ def importDbBackup():
|
|||||||
return mw.returnJson(True, 'ok')
|
return mw.returnJson(True, 'ok')
|
||||||
|
|
||||||
|
|
||||||
|
def rootPwd():
|
||||||
|
return pSqliteDb('config').where(
|
||||||
|
'id=?', (1,)).getField('mysql_root')
|
||||||
|
|
||||||
|
|
||||||
def importDbExternal():
|
def importDbExternal():
|
||||||
args = getArgs()
|
args = getArgs()
|
||||||
data = checkArgs(args, ['file', 'name'])
|
data = checkArgs(args, ['file', 'name'])
|
||||||
@@ -2740,6 +2745,8 @@ if __name__ == "__main__":
|
|||||||
print(setMyPort())
|
print(setMyPort())
|
||||||
elif func == 'init_pwd':
|
elif func == 'init_pwd':
|
||||||
print(initMysqlPwd())
|
print(initMysqlPwd())
|
||||||
|
elif func == 'root_pwd':
|
||||||
|
print(rootPwd())
|
||||||
elif func == 'get_db_list':
|
elif func == 'get_db_list':
|
||||||
print(getDbList())
|
print(getDbList())
|
||||||
elif func == 'set_db_backup':
|
elif func == 'set_db_backup':
|
||||||
|
|||||||
@@ -366,11 +366,15 @@ mw_connect_mysql(){
|
|||||||
INPUT_KEY=${SOURCE_LIST_KEY[$INPUT]}
|
INPUT_KEY=${SOURCE_LIST_KEY[$INPUT]}
|
||||||
CHOICE_DB=${DB_TYPE[$INPUT_KEY]}
|
CHOICE_DB=${DB_TYPE[$INPUT_KEY]}
|
||||||
echo "login to ${CHOICE_DB}:"
|
echo "login to ${CHOICE_DB}:"
|
||||||
pwd=$(python3 /www/server/mdserver-web/plugins/${CHOICE_DB}/index.py root_pwd)
|
pwd=$(cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/${CHOICE_DB}/index.py root_pwd)
|
||||||
if [ "$CHOICE_DB" == "mysql" ];then
|
if [ "$CHOICE_DB" == "mysql" ];then
|
||||||
${ROOT_PATH}/mysql/bin/mysql -uroot -p"${pwd}"
|
${ROOT_PATH}/mysql/bin/mysql -uroot -p"${pwd}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$CHOICE_DB" == "mariadb" ];then
|
||||||
|
${ROOT_PATH}/mariadb/bin/mysql -uroot -p"${pwd}"
|
||||||
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
|||||||
Reference in New Issue
Block a user