From f2d0de91f88e68b7dcc4a1f0eae04702d9aab6c0 Mon Sep 17 00:00:00 2001 From: midoks Date: Mon, 1 Aug 2022 10:09:40 +0800 Subject: [PATCH] Update index.py --- plugins/mysql/index.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index ae1ca45ed..c5f1f6e2d 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -371,6 +371,12 @@ def initMysqlPwd(): pwd + "') WHERE user='root';" cmd_pass = cmd_pass + "flush privileges;\"" data = mw.execShell(cmd_pass) + + # 删除测试数据库 + drop_test_db = serverdir + '/bin/mysql -uroot -p' + \ + pwd + ' -e "drop database test";' + mw.execShell(drop_test_db) + # print(data) pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,)) return True @@ -405,6 +411,11 @@ def initMysql8Pwd(): # print(data) os.remove(tmp_file) + # 删除测试数据库 + drop_test_db = serverdir + '/bin/mysql -uroot -p' + \ + pwd + ' -e "drop database test";' + mw.execShell(drop_test_db) + pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,)) return True