Skip to content

Commit

Permalink
Run mysqld as mysql user (#1397)
Browse files Browse the repository at this point in the history
* Run mysqld as mysql user

* Fix merge error

* Fixed merge error
  • Loading branch information
nwmac authored and richard-cox committed Dec 4, 2017
1 parent 1676a1b commit 2f2ea90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deploy/db/Dockerfile.mariadb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ COPY mariadb-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]

EXPOSE 3306
CMD ["mysqld", "--user=root"]
CMD ["mysqld", "--user=mysql"]
4 changes: 3 additions & 1 deletion deploy/db/mariadb-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if [ ! -d "$MYSQL_DATADIR/mysql" ]; then
# fi

echo 'Running mysql_install_db ...'
mysql_install_db --user=root --datadir="$MYSQL_DATADIR"
mysql_install_db --user=mysql --datadir="$MYSQL_DATADIR"
echo 'Finished mysql_install_db'

# These statements _must_ be on individual lines, and _must_ end with
Expand Down Expand Up @@ -42,6 +42,8 @@ EOSQL
set -- "$@" --init-file="$tempSqlFile"
fi

chown -R mysql:mysql "$MYSQL_DATADIR"
mkdir /var/run/mysql
chown -R mysql:mysql /var/run/mysql

exec "$@"

0 comments on commit 2f2ea90

Please sign in to comment.