Skip to content

Commit

Permalink
update default mariadb version to 10.11
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Jan 14, 2024
1 parent 574fb18 commit 9506038
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 12 deletions.
53 changes: 42 additions & 11 deletions install/installCyberPanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,23 +268,54 @@ def installMySQL(self, mysql):

############## Install mariadb ######################

mRepo = '/etc/yum.repos.d/MariaDB.repo'

if self.distro == ubuntu:

if get_Ubuntu_release() == 18.10:
command = 'DEBIAN_FRONTEND=noninteractive apt-get install software-properties-common -y'
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True)
command = 'DEBIAN_FRONTEND=noninteractive apt-get install software-properties-common -y'
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True)

command = "apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'"
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
command = "DEBIAN_FRONTEND=noninteractive apt-get install apt-transport-https curl -y"
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)

command = "add-apt-repository 'deb [arch=amd64,arm64,ppc64el] https://mirror.yongbok.net/mariadb/repo/10.4/ubuntu bionic main'"
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
command = "mkdir -p /etc/apt/keyrings"
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)

command = "DEBIAN_FRONTEND=noninteractive apt-get -y install mariadb-server"
command = "curl -o /etc/apt/keyrings/mariadb-keyring.pgp 'https://mariadb.org/mariadb_release_signing_key.pgp'"
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
RepoPath = '/etc/apt/sources.list.d/mariadb.sources'
RepoContent = f"""
# MariaDB 10.11 repository list - created 2023-12-11 07:53 UTC
# https://mariadb.org/download/
X-Repolib-Name: MariaDB
Types: deb
# deb.mariadb.org is a dynamic mirror if your preferred mirror goes offline. See https://mariadb.org/mirrorbits/ for details.
# URIs: https://deb.mariadb.org/10.11/ubuntu
URIs: https://mirrors.gigenet.com/mariadb/repo/10.11/ubuntu
Suites: jammy
Components: main main/debug
Signed-By: /etc/apt/keyrings/mariadb-keyring.pgp
"""
WriteToFile = open(RepoPath, 'w')
WriteToFile.write(RepoContent)
WriteToFile.close()


command = "DEBIAN_FRONTEND=noninteractive sudo apt-get install mariadb-server -y"
elif self.distro == centos:
command = 'yum --enablerepo=mariadb -y install MariaDB-server MariaDB-client'

RepoPath = '/etc/yum.repos.d/mariadb.repo'
RepoContent = f"""
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.11/rhel8-amd64
module_hotfixes=1
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
"""
WriteToFile = open(RepoPath, 'w')
WriteToFile.write(RepoContent)
WriteToFile.close()

command = 'dnf install mariadb-server -y'
elif self.distro == cent8 or self.distro == openeuler:
### check if cent8 which means Alma8 then add Mariadb 10.6 repo
# if self.distro == cent8:
Expand Down
1 change: 0 additions & 1 deletion plogical/mysqlUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,6 @@ def UpgradeMariaDB(versionToInstall, tempStatusPath):
WriteToFile.close()



command = 'dnf update -y'
result = ProcessUtilities.outputExecutioner(command, 'root', True)

Expand Down

0 comments on commit 9506038

Please sign in to comment.