Skip to content

Commit ee735d2

Browse files
committed
upgrade mariadb on cent7
1 parent 01a7247 commit ee735d2

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

install/installCyberPanel.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,30 @@ def installMySQL(self, mysql):
240240

241241
############## Install mariadb ######################
242242

243+
mRepo = '/etc/yum.repos.d/MariaDB.repo'
244+
243245
if self.distro == ubuntu:
246+
247+
248+
244249
command = "apt-get -y install mariadb-server"
245250
elif self.distro == centos:
246-
command = 'yum --enablerepo=CyberPanel -y install mariadb-server'
251+
mRepo = '/etc/yum.repos.d/MariaDB.repo'
252+
253+
content = """# MariaDB 10.5 CentOS repository list - created 2020-09-03 09:44 UTC
254+
# http://downloads.mariadb.org/mariadb/repositories/
255+
[mariadb]
256+
name = MariaDB
257+
baseurl = http://yum.mariadb.org/10.5/centos7-amd64
258+
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
259+
gpgcheck=1
260+
"""
261+
262+
writeToFile = open(mRepo, 'w')
263+
writeToFile.write(content)
264+
writeToFile.close()
265+
266+
command = 'yum --enablerepo=MariaDB -y install MariaDB-server MariaDB-client'
247267
elif self.distro == cent8:
248268
command = 'dnf -y install mariadb-server'
249269

0 commit comments

Comments
 (0)