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