mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-14 17:26:17 +01:00
bug fix for mysql 10.5
This commit is contained in:
@@ -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 + '"'
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user