update
This commit is contained in:
parent
8e81f423f9
commit
6d64401e22
|
|
@ -755,6 +755,11 @@ def importDbBackup():
|
|||
return mw.returnJson(True, 'ok')
|
||||
|
||||
|
||||
def rootPwd():
|
||||
return pSqliteDb('config').where(
|
||||
'id=?', (1,)).getField('mysql_root')
|
||||
|
||||
|
||||
def importDbExternal():
|
||||
args = getArgs()
|
||||
data = checkArgs(args, ['file', 'name'])
|
||||
|
|
@ -2740,6 +2745,8 @@ if __name__ == "__main__":
|
|||
print(setMyPort())
|
||||
elif func == 'init_pwd':
|
||||
print(initMysqlPwd())
|
||||
elif func == 'root_pwd':
|
||||
print(rootPwd())
|
||||
elif func == 'get_db_list':
|
||||
print(getDbList())
|
||||
elif func == 'set_db_backup':
|
||||
|
|
|
|||
|
|
@ -366,11 +366,15 @@ mw_connect_mysql(){
|
|||
INPUT_KEY=${SOURCE_LIST_KEY[$INPUT]}
|
||||
CHOICE_DB=${DB_TYPE[$INPUT_KEY]}
|
||||
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
|
||||
${ROOT_PATH}/mysql/bin/mysql -uroot -p"${pwd}"
|
||||
fi
|
||||
|
||||
if [ "$CHOICE_DB" == "mariadb" ];then
|
||||
${ROOT_PATH}/mariadb/bin/mysql -uroot -p"${pwd}"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
|
|
|
|||
Loading…
Reference in New Issue