Skip to content

Commit 2c5f26d

Browse files
authored
Replace MySQL with MariaDB 10.3
2 parents 70c828a + 89a441f commit 2c5f26d

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

install/hst-install-ubuntu.sh

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ software="apache2 apache2.2-common apache2-suexec-custom apache2-utils
2525
cron curl dnsutils dovecot-imapd dovecot-pop3d e2fslibs e2fsprogs exim4
2626
exim4-daemon-heavy expect fail2ban flex ftp git idn imagemagick
2727
libapache2-mod-fcgid libapache2-mod-php libapache2-mod-rpaf
28-
libapache2-mod-ruid2 lsof mc mysql-client mysql-common mysql-server nginx
28+
libapache2-mod-ruid2 lsof mc mariadb-client mariadb-common mariadb-server nginx
2929
ntpdate php-cgi php-common php-curl phpmyadmin php-mysql phppgadmin
3030
php-pgsql postgresql postgresql-contrib proftpd-basic quota roundcube-core
3131
roundcube-mysql roundcube-plugins rrdtool rssh spamassassin sudo hestia
@@ -41,7 +41,7 @@ help() {
4141
-v, --vsftpd Install Vsftpd [yes|no] default: yes
4242
-j, --proftpd Install ProFTPD [yes|no] default: no
4343
-k, --named Install Bind [yes|no] default: yes
44-
-m, --mysql Install MySQL [yes|no] default: yes
44+
-m, --mysql Install MariaDB [yes|no] default: yes
4545
-g, --postgresql Install PostgreSQL [yes|no] default: no
4646
-x, --exim Install Exim [yes|no] default: yes
4747
-z, --dovecot Install Dovecot [yes|no] default: yes
@@ -170,7 +170,7 @@ while getopts "a:n:w:v:j:k:m:g:d:x:z:c:t:i:b:r:o:q:l:y:s:e:p:fh" Option; do
170170
v) vsftpd=$OPTARG ;; # Vsftpd
171171
j) proftpd=$OPTARG ;; # Proftpd
172172
k) named=$OPTARG ;; # Named
173-
m) mysql=$OPTARG ;; # MySQL
173+
m) mysql=$OPTARG ;; # MariaDB
174174
g) postgresql=$OPTARG ;; # PostgreSQL
175175
x) exim=$OPTARG ;; # Exim
176176
z) dovecot=$OPTARG ;; # Dovecot
@@ -284,7 +284,7 @@ check_result $? "No access to Hestia repository"
284284
# Checking installed packages
285285
tmpfile=$(mktemp -p /tmp)
286286
dpkg --get-selections > $tmpfile
287-
for pkg in exim4 mysql-server apache2 nginx hestia; do
287+
for pkg in exim4 mariadb-server apache2 nginx hestia; do
288288
if [ ! -z "$(grep $pkg $tmpfile)" ]; then
289289
conflicts="$pkg $conflicts"
290290
fi
@@ -366,7 +366,7 @@ fi
366366

367367
# Database stack
368368
if [ "$mysql" = 'yes' ]; then
369-
echo ' - MySQL Database Server'
369+
echo ' - MariaDB Database Server'
370370
fi
371371
if [ "$postgresql" = 'yes' ]; then
372372
echo ' - PostgreSQL Database Server'
@@ -478,6 +478,11 @@ if [ "$multiphp" = 'yes' ] || [ "$phpfpm" = 'yes' ]; then
478478
add-apt-repository -y ppa:ondrej/php > /dev/null 2>&1
479479
fi
480480

481+
# Installing MariaDB repo
482+
apt=/etc/apt/sources.list.d
483+
echo "deb http://ams2.mirrors.digitalocean.com/mariadb/repo/10.3/ubuntu $codename main" > $apt/mariadb.list
484+
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
485+
481486
# Installing hestia repo
482487
echo "deb https://$RHOST/ $codename main" > $apt/hestia.list
483488
wget --quiet https://gpg.hestiacp.com/deb_signing.key -O /tmp/deb_signing.key
@@ -600,9 +605,9 @@ if [ "$dovecot" = 'no' ]; then
600605
software=$(echo "$software" | sed -e "s/dovecot-pop3d//")
601606
fi
602607
if [ "$mysql" = 'no' ]; then
603-
software=$(echo "$software" | sed -e 's/mysql-server//')
604-
software=$(echo "$software" | sed -e 's/mysql-client//')
605-
software=$(echo "$software" | sed -e 's/mysql-common//')
608+
software=$(echo "$software" | sed -e 's/mariadb-server//')
609+
software=$(echo "$software" | sed -e 's/mariadb-client//')
610+
software=$(echo "$software" | sed -e 's/mariadb-common//')
606611
software=$(echo "$software" | sed -e 's/php7.0-mysql//')
607612
software=$(echo "$software" | sed -e 's/php5-mysql//')
608613
software=$(echo "$software" | sed -e 's/php-mysql//')
@@ -1027,7 +1032,7 @@ fi
10271032

10281033

10291034
#----------------------------------------------------------#
1030-
# Configure MySQL/MariaDB #
1035+
# Configure MariaDB #
10311036
#----------------------------------------------------------#
10321037

10331038
if [ "$mysql" = 'yes' ]; then
@@ -1039,7 +1044,7 @@ if [ "$mysql" = 'yes' ]; then
10391044
mycnf="my-large.cnf"
10401045
fi
10411046

1042-
# Configuring MySQL/MariaDB
1047+
# Configuring MariaDB
10431048
cp -f $hestiacp/mysql/$mycnf /etc/mysql/my.cnf
10441049
if [ "$release" = '14.04' ]; then
10451050
mysql_install_db > /dev/null 2>&1
@@ -1058,9 +1063,9 @@ if [ "$mysql" = 'yes' ]; then
10581063
fi
10591064
update-rc.d mysql defaults
10601065
service mysql start
1061-
check_result $? "mysql start failed"
1066+
check_result $? "mariadb start failed"
10621067

1063-
# Securing MySQL/MariaDB installation
1068+
# Securing MariaDB installation
10641069
mpass=$(gen_pass)
10651070
mysqladmin -u root password $mpass > /dev/null 2>&1
10661071
echo -e "[client]\npassword='$mpass'\n" > /root/.my.cnf
@@ -1390,7 +1395,7 @@ if [ ! -z "$pub_ip" ] && [ "$pub_ip" != "$ip" ]; then
13901395
ip=$pub_ip
13911396
fi
13921397

1393-
# Configuring MySQL/MariaDB host
1398+
# Configuring MariaDB host
13941399
if [ "$mysql" = 'yes' ]; then
13951400
$HESTIA/bin/v-add-database-host mysql localhost root $mpass
13961401
fi

0 commit comments

Comments
 (0)