Update index.py

pull/109/head
midoks 3 years ago
parent 0c2c190298
commit 687ece0f77
  1. 12
      plugins/mysql/index.py

@ -451,18 +451,18 @@ def my57cmd(version, method):
ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER ;\ ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER ;\
update user set authentication_string = password('root') where user = 'root' ;\ update user set authentication_string = password('root') where user = 'root' ;\
flush privileges;" flush privileges;"
print(sql)
mw.writeFile(sql_file_path, sql) mw.writeFile(sql_file_path, sql)
cmd_init_two = gsDir + "/bin/mysql --defaults-file=" + gsDir + \ cmd_init_two = gsDir + "/bin/mysql --defaults-file=" + gsDir + \
"/etc/my.cnf --connect-expired-password -uroot -proot123 < " + sql_file_path "/etc/my.cnf --connect-expired-password -uroot -proot123 < " + sql_file_path
subprocess.Popen(cmd_init_two, stdout=subprocess.PIPE, shell=True, mw.execShell(cmd_init_two)
bufsize=4096, stderr=subprocess.PIPE)
cmd_init_stop = gsDir + \ # cmd_init_stop = gsDir + \
"/bin/mysqladmin --defaults-file=" + gsDir + "/etc/my.cnf -uroot -proot shutdown" # "/bin/mysqladmin --defaults-file=" + gsDir + "/etc/my.cnf -uroot -proot shutdown"
subprocess.Popen(cmd_init_stop, stdout=subprocess.PIPE, shell=True, # subprocess.Popen(cmd_init_stop, stdout=subprocess.PIPE, shell=True,
bufsize=4096, stderr=subprocess.PIPE) # bufsize=4096, stderr=subprocess.PIPE)
# if initData == 0: # if initData == 0:
# initMysqlPwd() # initMysqlPwd()
return 'ok' return 'ok'

Loading…
Cancel
Save