mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 05:15:49 +01:00
Fix MariaDB issues
This commit is contained in:
@@ -8,6 +8,8 @@ import installLog as logging
|
|||||||
import shlex
|
import shlex
|
||||||
import randomPassword
|
import randomPassword
|
||||||
import errno
|
import errno
|
||||||
|
import MySQLdb as mariadb
|
||||||
|
import re
|
||||||
import time
|
import time
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@@ -616,6 +618,35 @@ class InstallCyberPanel:
|
|||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
def fixMariaDB(self):
|
||||||
|
self.stdOut("Setup MariaDB so it can support Cyberpanel's needs")
|
||||||
|
try:
|
||||||
|
conn = mariadb.connect(user='root', passwd=mysql_Root_password)
|
||||||
|
cursor = conn.cursor()
|
||||||
|
cursor.execute('set global innodb_file_per_table = on;')
|
||||||
|
cursor.exeucte('set global innodb_file_format = Barracuda;')
|
||||||
|
cursor.execute('set global innodb_large_prefix = on;')
|
||||||
|
cursor.close()
|
||||||
|
conn.close()
|
||||||
|
except:
|
||||||
|
self.stdOut("Error in setting MariaDB global options", 1, 1, os.EX_OSERR)
|
||||||
|
|
||||||
|
try:
|
||||||
|
fileName = '/etc/mysql/mariadb.conf.d/50-server.cnf'
|
||||||
|
data = open(fileName, 'r').readlines()
|
||||||
|
|
||||||
|
writeDataToFile = open(fileName, 'w')
|
||||||
|
for line in data:
|
||||||
|
writeDataToFile.write(line.replace('utf8mb4','utf8'))
|
||||||
|
writeDataToFile.close()
|
||||||
|
except IOError as err:
|
||||||
|
self.stdOut("Error in setting: " + fileName + ": " + str(err), 1, 1, os.EX_OSERR)
|
||||||
|
|
||||||
|
os.system('systemctl restart mysql')
|
||||||
|
|
||||||
|
self.stdOut("MariaDB is now setup so it can support Cyberpanel's needs")
|
||||||
|
|
||||||
|
|
||||||
def installPureFTPD(self):
|
def installPureFTPD(self):
|
||||||
try:
|
try:
|
||||||
|
|
||||||
@@ -937,6 +968,7 @@ class InstallCyberPanel:
|
|||||||
while(1):
|
while(1):
|
||||||
if self.distro == ubuntu:
|
if self.distro == ubuntu:
|
||||||
command = "DEBIAN_FRONTEND=noninteractive apt-get -y install pdns-server pdns-backend-mysql"
|
command = "DEBIAN_FRONTEND=noninteractive apt-get -y install pdns-server pdns-backend-mysql"
|
||||||
|
res = os.system(command)
|
||||||
else:
|
else:
|
||||||
command = 'yum -y install pdns pdns-backend-mysql'
|
command = 'yum -y install pdns pdns-backend-mysql'
|
||||||
cmd = shlex.split(command)
|
cmd = shlex.split(command)
|
||||||
@@ -1243,6 +1275,8 @@ def Main(cwd, mysql, distro):
|
|||||||
if distro == centos and mysql == 'Two':
|
if distro == centos and mysql == 'Two':
|
||||||
installer.changeMYSQLRootPasswordCyberPanel(mysql)
|
installer.changeMYSQLRootPasswordCyberPanel(mysql)
|
||||||
installer.startMariaDB()
|
installer.startMariaDB()
|
||||||
|
if distro == ubuntu:
|
||||||
|
installer.fixMariaDB()
|
||||||
|
|
||||||
mysqlUtilities.createDatabaseCyberPanel("cyberpanel", "cyberpanel", InstallCyberPanel.mysqlPassword, mysql)
|
mysqlUtilities.createDatabaseCyberPanel("cyberpanel", "cyberpanel", InstallCyberPanel.mysqlPassword, mysql)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user