From 8f229c99be94847996142924e5df6da44cb7a023 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 22 Dec 2023 05:05:48 +0800 Subject: [PATCH] Update index.py --- plugins/mariadb/index.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/mariadb/index.py b/plugins/mariadb/index.py index ec907317a..3c299fe1e 100755 --- a/plugins/mariadb/index.py +++ b/plugins/mariadb/index.py @@ -798,6 +798,8 @@ def rootPwd(): 'id=?', (1,)).getField('mysql_root') +# python3 plugins/mariadb/index.py import_db_external {"file":"xx.sql","name":"demo1"} +# python3 plugins/mariadb/index.py import_db_external {"file":"db_demo1_20231221_203614 2.sql","name":"demo1"} def importDbExternal(): args = getArgs() data = checkArgs(args, ['file', 'name']) @@ -855,7 +857,7 @@ def importDbExternal(): os.environ["MYSQL_PWD"] = pwd mysql_cmd = getServerDir() + '/bin/mariadb -S ' + sock + ' -uroot -p"' + \ - pwd + '" ' + name + ' < ' + import_sql + pwd + '" ' + name + ' < "' + import_sql+'"' # print(mysql_cmd) os.system(mysql_cmd)