pull/256/head
midoks 3 years ago
parent e3fcb14efc
commit b3f0358814
  1. 6
      plugins/mariadb/index.py
  2. 2
      plugins/mysql-apt/index.py
  3. 2
      plugins/mysql/index.py

@ -363,12 +363,18 @@ def initMariaDbPwd():
print("init mariadb password fail:" + data[1])
exit(1)
# 删除空账户
drop_empty_user = serverdir + '/bin/mysql ' + db_option + '-uroot -p' + \
pwd + ' -e "use mysql;delete from user where USER=\'\'"'
mw.execShell(drop_empty_user)
# 删除测试数据库
drop_test_db = serverdir + '/bin/mysql ' + db_option + ' -uroot -p' + \
pwd + ' -e "drop database test";'
mw.execShell(drop_test_db)
# 删除冗余账户
if hostname != 'hostname':
hostname = mw.execShell('hostname')[0].strip()
drop_hostname = serverdir + '/bin/mysql --defaults-file=' + \
myconf + ' -uroot -p' + pwd + ' -e "drop user \'\'@\'' + hostname + '\'";'

@ -345,7 +345,7 @@ def initMysql8Pwd():
# 删除冗余账户
hostname = mw.execShell('hostname')[0].strip()
if hostname != 'localhost':
drop_hostname = cmd_my + ' --defaults-file=' + \
myconf + ' -uroot -p' + pwd + ' -e "drop user \'\'@\'' + hostname + '\'";'
mw.execShell(drop_hostname)

@ -428,7 +428,7 @@ def initMysqlPwd():
# 删除冗余账户
hostname = mw.execShell('hostname')[0].strip()
if hostname != 'hostname':
drop_hostname = serverdir + '/bin/mysql --defaults-file=' + \
myconf + ' -uroot -p' + pwd + ' -e "drop user \'\'@\'' + hostname + '\'";'
mw.execShell(drop_hostname)

Loading…
Cancel
Save