diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index e8a96d352..3dda72f36 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -482,14 +482,13 @@ def initMysql8Pwd(): # 删除冗余账户 hostname = mw.execShell('hostname')[0] - drop_hostname = "drop user ''@'" + hostname + "'" drop_hostname = serverdir + '/bin/mysql --defaults-file=' + \ - myconf + ' -uroot -p' + pwd + ' -e "drop user ''@' + hostname + '";' + myconf + ' -uroot -p' + pwd + ' -e "drop user \'\'@\'' + hostname + '\'";' mw.execShell(drop_hostname) drop_root_hostname = serverdir + '/bin/mysql --defaults-file=' + \ - myconf + ' -uroot -p' + pwd + ' -e "drop user \'root\'@' + hostname + '";' + myconf + ' -uroot -p' + pwd + ' -e "drop user \'root\'@\'' + hostname + '\'";' mw.execShell(drop_root_hostname) pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))