Browse Source

Fix configuration issue for mysql on Ubuntu 18.04 and hide output of phpmyadmin fix.

Raphael Schneeberger 7 years ago
parent
commit
b23c3aed2a
2 changed files with 17 additions and 7 deletions
  1. 1 1
      install/hst-install-debian.sh
  2. 16 6
      install/hst-install-ubuntu.sh

+ 1 - 1
install/hst-install-debian.sh

@@ -1327,7 +1327,7 @@ fi
 # Special thanks to Pavel Galkin (https://skurudo.ru)
 # https://github.com/skurudo/phpmyadmin-fixer
 
-source $hestiacp/phpmyadmin/pma.sh
+source $hestiacp/phpmyadmin/pma.sh > /dev/null 2>&1
 
 #----------------------------------------------------------#
 #                   Configure Admin User                   #

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

@@ -1068,11 +1068,21 @@ if [ "$mysql" = 'yes' ]; then
     mysqladmin -u root password $mpass
     echo -e "[client]\npassword='$mpass'\n" > /root/.my.cnf
     chmod 600 /root/.my.cnf
-    mysql -e "DELETE FROM mysql.user WHERE User=''"
-    mysql -e "DROP DATABASE test" >/dev/null 2>&1
-    mysql -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'"
-    mysql -e "DELETE FROM mysql.user WHERE user='' OR password='';"
-    mysql -e "FLUSH PRIVILEGES"
+    if [ "$release" = '16.04' ]; then
+        mysql -e "DELETE FROM mysql.user WHERE User=''"
+        mysql -e "DROP DATABASE test" >/dev/null 2>&1
+        mysql -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'"
+        mysql -e "DELETE FROM mysql.user WHERE user='' OR password='';"
+        mysql -e "FLUSH PRIVILEGES"
+    fi
+    if [ "$release" = '18.04' ]; then
+        mysql -e "DELETE FROM mysql.user WHERE User=''"
+        mysql -e "DROP DATABASE test" >/dev/null 2>&1
+        mysql -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'"
+        mysql -e "DELETE FROM mysql.user WHERE user='';"
+        mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '$mpass';"
+        mysql -e "FLUSH PRIVILEGES"
+    fi
 
     # Configuring phpMyAdmin
     if [ "$apache" = 'yes' ]; then
@@ -1299,7 +1309,7 @@ fi
 # Special thanks to Pavel Galkin (https://skurudo.ru)
 # https://github.com/skurudo/phpmyadmin-fixer
 
-source $hestiacp/phpmyadmin/pma.sh
+source $hestiacp/phpmyadmin/pma.sh  > /dev/null 2>&1
 
 
 #----------------------------------------------------------#