bug fix for mysql 10.5

This commit is contained in:
Usman Nasir
2020-09-03 19:24:12 +05:00
parent afa85fb2aa
commit c1d9e6a832
2 changed files with 7 additions and 2 deletions

View File

@@ -283,10 +283,11 @@ gpgcheck=1
def changeMYSQLRootPassword(self):
if self.remotemysql == 'OFF':
if self.distro == ubuntu:
passwordCMD = "use mysql;update user set password=PASSWORD('" + InstallCyberPanel.mysql_Root_password + "') where User='root';UPDATE user SET plugin='' WHERE User='root';flush privileges;"
passwordCMD = "use mysql;GRANT ALL PRIVILEGES ON . TO 'root'@'localhost' IDENTIFIED BY '%s';update user set password=PASSWORD('" % (InstallCyberPanel.mysql_Root_password) + InstallCyberPanel.mysql_Root_password + "') where User='root';UPDATE user SET plugin='' WHERE User='root';flush privileges;"
else:
passwordCMD = "use mysql;update user set password=PASSWORD('" + InstallCyberPanel.mysql_Root_password + "') where User='root';flush privileges;"
passwordCMD = "use mysql;GRANT ALL PRIVILEGES ON . TO 'root'@'localhost' IDENTIFIED BY '%s';update user set password=PASSWORD('" % (InstallCyberPanel.mysql_Root_password) + InstallCyberPanel.mysql_Root_password + "') where User='root';flush privileges;"
command = 'mysql -u root -e "' + passwordCMD + '"'

View File

@@ -95,9 +95,13 @@ class mysqlUtilities:
password = data.split('\n', 1)[0]
password = password.strip('\n').strip('\r')
logging.CyberCPLogFileWriter.writeToFile(repr(password))
conn = mysql.connect(user='root', passwd=password, cursorclass=cursors.SSCursor)
cursor = conn.cursor()
logging.CyberCPLogFileWriter.writeToFile(str(cursor))
return conn, cursor
except BaseException as msg: