From f37c2c9bc6f56320cf85a350dc1471e98ed918a0 Mon Sep 17 00:00:00 2001 From: midoks Date: Sat, 31 Dec 2022 16:46:28 +0800 Subject: [PATCH] Update index.py --- plugins/mysql/index.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index a41739c67..23105772d 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -930,6 +930,11 @@ def importDbBackup(): cmd = 'cd ' + mw.getRootDir() + '/backup/database && gzip -d ' + file mw.execShell(cmd) + local_mode = recognizeDbMode() + if local_mode == 'gtid': + pdb = pMysqlDb() + pdb.execute('reset master') + pwd = pSqliteDb('config').where('id=?', (1,)).getField('mysql_root') sock = getSocketFile() mysql_cmd = getServerDir() + '/bin/mysql -S ' + sock + ' -uroot -p' + pwd + \