Skip to content

Commit 0912ba1

Browse files
committed
Fix ubuntu related mysql error output.
1 parent ac9d81c commit 0912ba1

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

install/hst-install-ubuntu.sh

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -538,18 +538,6 @@ killall -9 mysqld > /dev/null 2>&1
538538
mv /var/lib/mysql $hst_backups/mysql/mysql_datadir > /dev/null 2>&1
539539
cp -r /etc/mysql/* $hst_backups/mysql > /dev/null 2>&1
540540
mv -f /root/.my.cnf $hst_backups/mysql > /dev/null 2>&1
541-
if [ "$release" = '16.04' ] || [ "$release" = '18.04' ]; then
542-
if [ -e '/etc/init.d/mysql' ]; then
543-
if [ -d '/var/lib/mysql' ]; then
544-
rm -fr /var/lib/mysql
545-
mkdir -p /var/lib/mysql
546-
else
547-
mkdir -p /var/lib/mysql
548-
fi
549-
chown mysql:mysql /var/lib/mysql
550-
mysqld --initialize-insecure
551-
fi
552-
fi
553541

554542
# Backup Hestia
555543
service hestia stop > /dev/null 2>&1
@@ -1058,14 +1046,19 @@ if [ "$mysql" = 'yes' ]; then
10581046
# Configuring MySQL/MariaDB
10591047
cp -f $hestiacp/mysql/$mycnf /etc/mysql/my.cnf
10601048
if [ "$release" = '14.04' ]; then
1061-
mysql_install_db
1049+
mysql_install_db >/dev/null 2>&1
10621050
fi
10631051
if [ "$release" = '16.04' ] || [ "$release" = '18.04' ]; then
1064-
if [ ! -d "/var/lib/mysql" ]; then
1065-
mkdir /var/lib/mysql
1052+
if [ -e '/etc/init.d/mysql' ]; then
1053+
if [ -d '/var/lib/mysql' ]; then
1054+
rm -fr /var/lib/mysql
1055+
mkdir -p /var/lib/mysql
1056+
else
1057+
mkdir -p /var/lib/mysql
1058+
fi
1059+
chown mysql:mysql /var/lib/mysql
1060+
mysqld --initialize-insecure >/dev/null 2>&1
10661061
fi
1067-
chown mysql:mysql /var/lib/mysql
1068-
mysqld --initialize-insecure
10691062
fi
10701063
update-rc.d mysql defaults
10711064
service mysql start

0 commit comments

Comments
 (0)