Parcourir la source

package/mariadb: do not pass --user=mysql to mysql_install_db

We currently install the default database by passing --user=mysql to the
install script. With the upcoming bump to the 10.4 series, this does not
work as intended. An error occurs because of missing PAM modules. We work
around this now by creating the default db as root and calling chown to
change the files to user mysql.

Signed-off-by: Ryan Coe <bluemrp9@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Ryan Coe il y a 5 ans
Parent
commit
6b74423025
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      package/mariadb/S97mysqld

+ 2 - 1
package/mariadb/S97mysqld

@@ -27,12 +27,13 @@ start() {
 	# if mysql lib directory doesn't exist
 	# if mysql lib directory doesn't exist
 	if [ `ls -1 $MYSQL_LIB 2> /dev/null | wc -l` = 0 ] ; then
 	if [ `ls -1 $MYSQL_LIB 2> /dev/null | wc -l` = 0 ] ; then
 		printf "Creating mysql system tables ... "
 		printf "Creating mysql system tables ... "
-		$MYSQL_BIN/mysql_install_db --basedir=/usr --user=mysql \
+		$MYSQL_BIN/mysql_install_db --basedir=/usr \
 			--datadir=$MYSQL_LIB > /dev/null 2>&1
 			--datadir=$MYSQL_LIB > /dev/null 2>&1
 		if [ $? != 0 ]; then
 		if [ $? != 0 ]; then
 			echo "FAIL"
 			echo "FAIL"
 			exit 1
 			exit 1
 		fi
 		fi
+		chown -R mysql:mysql $MYSQL_LIB
 		echo "OK"
 		echo "OK"
 	fi
 	fi