Skip to content

Commit

Permalink
Apparently some user perms issues with the newly created root user
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Van Fleet committed Sep 5, 2016
1 parent f890d38 commit a7360fd
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions container_files/bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ if [ -e "/tmp/firsttimerunning" ]; then


if [ "$MYSQL_DATABASE" != "" ]; then
echo "flush privileges;" >> "$tempSqlFile"
echo "CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` ;" >> "$tempSqlFile"
echo "CREATE USER '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASSWORD' ;" >> "$tempSqlFile"
echo "GRANT ALL ON $MYSQL_DATABASE.* TO '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASSWORD' ;" >> "$tempSqlFile"
echo "GRANT ALL ON $MYSQL_DATABASE.* TO '$MYSQL_USER'@'localhost' IDENTIFIED BY '$MYSQL_PASSWORD' ;" >> "$tempSqlFile"
echo "GRANT ALL ON $MYSQL_DATABASE.* TO '$MYSQL_USER'@'$MYSQL_DATABASE.%_i2network' IDENTIFIED BY '$MYSQL_PASSWORD' ;" >> "$tempSqlFile"
echo "GRANT ALL ON $MYSQL_DATABASE.* TO '$MYSQL_USER'@'$MYSQL_DATABASE.%_i2network' IDENTIFIED BY '$MYSQL_PASSWORD' ;" >> "$tempSqlFile"
echo "GRANT ALL ON $MYSQL_DATABASE.* TO '$MYSQL_USER'@'$MYSQL_DATABASE.%_i2network' IDENTIFIED BY '$MYSQL_PASSWORD' ;" >> "$tempSqlFile"
fi

echo 'FLUSH PRIVILEGES ;' >> "$tempSqlFile"
Expand All @@ -67,13 +71,6 @@ if [ -e "/tmp/firsttimerunning" ]; then
/usr/bin/mysqld_safe --init-file="$tempSqlFile" --datadir="$MYSQL_DATADIR"
else
echo "Not Creating a MariaDB - Using Existing from DataDir: $MYSQL_DATADIR" >> $log

echo "Fixing Permissions" >> $log
chown -R mysql:mysql $MYSQL_DATADIR
/opt/bin/fix-permissions.sh $MYSQL_DATADIR >> $log
/opt/bin/fix-permissions.sh /var/log/mariadb/ >> $log
/opt/bin/fix-permissions.sh /var/run/ >> $log

/usr/bin/mysqld_safe --datadir="$MYSQL_DATADIR"
fi

Expand Down

0 comments on commit a7360fd

Please sign in to comment.