mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-17 10:41:01 +01:00
bug fix for mysql 10.5
This commit is contained in:
@@ -283,10 +283,11 @@ gpgcheck=1
|
|||||||
|
|
||||||
def changeMYSQLRootPassword(self):
|
def changeMYSQLRootPassword(self):
|
||||||
if self.remotemysql == 'OFF':
|
if self.remotemysql == 'OFF':
|
||||||
|
|
||||||
if self.distro == ubuntu:
|
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:
|
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 + '"'
|
command = 'mysql -u root -e "' + passwordCMD + '"'
|
||||||
|
|
||||||
|
|||||||
@@ -95,9 +95,13 @@ class mysqlUtilities:
|
|||||||
password = data.split('\n', 1)[0]
|
password = data.split('\n', 1)[0]
|
||||||
password = password.strip('\n').strip('\r')
|
password = password.strip('\n').strip('\r')
|
||||||
|
|
||||||
|
logging.CyberCPLogFileWriter.writeToFile(repr(password))
|
||||||
|
|
||||||
conn = mysql.connect(user='root', passwd=password, cursorclass=cursors.SSCursor)
|
conn = mysql.connect(user='root', passwd=password, cursorclass=cursors.SSCursor)
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
|
||||||
|
logging.CyberCPLogFileWriter.writeToFile(str(cursor))
|
||||||
|
|
||||||
return conn, cursor
|
return conn, cursor
|
||||||
|
|
||||||
except BaseException as msg:
|
except BaseException as msg:
|
||||||
|
|||||||
Reference in New Issue
Block a user