Browse Source

Prevent error message on mysql initialize.

Raphael Schneeberger 7 years ago
parent
commit
eab5c3c931
1 changed files with 6 additions and 1 deletions
  1. 6 1
      install/hst-install-ubuntu.sh

+ 6 - 1
install/hst-install-ubuntu.sh

@@ -540,7 +540,12 @@ cp -r /etc/mysql/* $hst_backups/mysql > /dev/null 2>&1
 mv -f /root/.my.cnf $hst_backups/mysql > /dev/null 2>&1
 if [ "$release" = '16.04' ] || [ "$release" = '18.04' ]; then
     if [ -e '/etc/init.d/mysql' ]; then
-        mkdir -p /var/lib/mysql > /dev/null 2>&1
+        if [ -d '/var/lib/mysql' ]; then
+            rm -fr /var/lib/mysql
+            mkdir -p /var/lib/mysql
+        else
+            mkdir -p /var/lib/mysql
+        fi
         chown mysql:mysql /var/lib/mysql
         mysqld --initialize-insecure
     fi