Skip to content

Commit ee8f167

Browse files
committed
Merge pull request #58 from infosiftr/mysql-env-vars
Added documentation for MySQL environment variables
2 parents a3181d2 + 4e02711 commit ee8f167

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

mysql/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,22 @@ This image includes `EXPOSE 3306` (the mysql port), so standard container linkin
3131

3232
docker run -it --link some-mysql:mysql --rm mysql sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"'
3333

34+
## Environment Variables
35+
36+
The MySQL image uses several environment variables which are easy to miss. While not all the variables are required, they may significantly aid you in using the image.
37+
38+
### `MYSQL_ROOT_PASSWORD`
39+
40+
This is the one environment variable that is required for you to use the MySQL image. This environment variable should be what you want to set the root password for MySQL to. In the above example, it is being set to "mysecretpassword".
41+
42+
### `MYSQL_USER`, `MYSQL_PASSWORD`
43+
44+
These optional environment variables are used in conjunction to set both a MySQL user and password, which will subsequently be granted all permissions for the database specified by the optional `MYSQL_DATABASE` variable. Note that if you only have one of these two environment variables, then neither will actually do anything - these two are meant to be used in conjunction with one another.
45+
46+
### `MYSQL_DATABASE`
47+
48+
This optional environment variable denotes the name of a database to create. If a user/password was supplied (via the `MYSQL_USER` and `MYSQL_PASSWORD` environment variables) then that user account will be granted (`GRANT ALL`) access to this database.
49+
3450
# User Feedback
3551

3652
## Issues

mysql/content.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,19 @@ This image includes `EXPOSE 3306` (the mysql port), so standard container linkin
2525
## ... or via `mysql`
2626

2727
docker run -it --link some-mysql:mysql --rm mysql sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"'
28+
29+
## Environment Variables
30+
31+
The MySQL image uses several environment variables which are easy to miss. While not all the variables are required, they may significantly aid you in using the image.
32+
33+
### `MYSQL_ROOT_PASSWORD`
34+
35+
This is the one environment variable that is required for you to use the MySQL image. This environment variable should be what you want to set the root password for MySQL to. In the above example, it is being set to "mysecretpassword".
36+
37+
### `MYSQL_USER`, `MYSQL_PASSWORD`
38+
39+
These optional environment variables are used in conjunction to set both a MySQL user and password, which will subsequently be granted all permissions for the database specified by the optional `MYSQL_DATABASE` variable. Note that if you only have one of these two environment variables, then neither will actually do anything - these two are meant to be used in conjunction with one another.
40+
41+
### `MYSQL_DATABASE`
42+
43+
This optional environment variable denotes the name of a database to create. If a user/password was supplied (via the `MYSQL_USER` and `MYSQL_PASSWORD` environment variables) then that user account will be granted (`GRANT ALL`) access to this database.

0 commit comments

Comments
 (0)