File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ Change the database image to use MySQL instead of PostgreSQL in `compose.yaml`:
2020``` diff
2121 ###> doctrine/doctrine-bundle ###
2222- image: postgres:${POSTGRES_VERSION:-16}-alpine
23- + image: mysql:${MYSQL_VERSION:-8}
23+ + image: mysql:${MYSQL_VERSION:-8.0.32 }
2424 environment:
2525- POSTGRES_DB: ${POSTGRES_DB:-app}
2626+ MYSQL_DATABASE: ${MYSQL_DATABASE:-app}
@@ -51,7 +51,7 @@ Depending on the database configuration,
5151modify the environment in the same file at ` services.php.environment.DATABASE_URL ` :
5252
5353``` yaml
54- DATABASE_URL : mysql://${MYSQL_USER:-app}:${MYSQL_PASSWORD:-!ChangeMe!}@database:3306/${MYSQL_DATABASE:-app}?serverVersion=${MYSQL_VERSION:-8}&charset=${MYSQL_CHARSET:-utf8mb4}
54+ DATABASE_URL : mysql://${MYSQL_USER:-app}:${MYSQL_PASSWORD:-!ChangeMe!}@database:3306/${MYSQL_DATABASE:-app}?serverVersion=${MYSQL_VERSION:-8.0.32 }&charset=${MYSQL_CHARSET:-utf8mb4}
5555` ` `
5656
5757Since we changed the port, we also have to define this in the ` compose.override.yaml`:
@@ -79,7 +79,7 @@ Last but not least, we need to install the MySQL driver in `Dockerfile`:
7979Change the database configuration in `.env` :
8080
8181` ` ` dotenv
82- DATABASE_URL=mysql://${MYSQL_USER:-app}:${MYSQL_PASSWORD:-!ChangeMe!}@database:3306/${MYSQL_DATABASE:-app}?serverVersion=${MYSQL_VERSION:-8}&charset=${MYSQL_CHARSET:-utf8mb4}
82+ DATABASE_URL=mysql://${MYSQL_USER:-app}:${MYSQL_PASSWORD:-!ChangeMe!}@database:3306/${MYSQL_DATABASE:-app}?serverVersion=${MYSQL_VERSION:-8.0.32 }&charset=${MYSQL_CHARSET:-utf8mb4}
8383` ` `
8484
8585# # Final steps
You can’t perform that action at this time.
0 commit comments