From 8e1b4881c41674bd8dbaf23c0ef0fa9ea91fea91 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 22 Dec 2023 04:22:10 +0800 Subject: [PATCH] Update index.py --- plugins/mariadb/index.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/mariadb/index.py b/plugins/mariadb/index.py index efd71d024..173c80096 100755 --- a/plugins/mariadb/index.py +++ b/plugins/mariadb/index.py @@ -2672,7 +2672,7 @@ def doFullSyncUser(version=''): if not os.path.exists(bak_file): # https://mariadb.com/kb/zh-cn/mariadb-dump/ dump_sql_data = getServerDir() + "/bin/mariadb-dump -f --opt --default-character-set=utf8 --single-transaction -h" + ip + " -P" + \ - port + " -u" + user + " -p'" + apass + "' " + sync_db + " > " + bak_file + port + " -u" + user + " -p'" + apass + "' " + sync_db + ">" + bak_file print(dump_sql_data) mw.execShell(dump_sql_data) @@ -2681,7 +2681,8 @@ def doFullSyncUser(version=''): pwd = pSqliteDb('config').where('id=?', (1,)).getField('mysql_root') sock = getSocketFile() my_import_cmd = getServerDir() + '/bin/mariadb -S ' + sock + " -uroot -p'" + pwd + \ - "' " + sync_db + ' < ' + bak_file + "' " + sync_db + '<' + bak_file + print(my_import_cmd) mw.execShell(my_import_cmd) pinfo = parseSlaveSyncCmd(data['cmd'])