January 2019
Intermediate to advanced
520 pages
14h 32m
English
To bootstrap the database, we also will use a Docker image. You can install MySQL locally, but a container is a more flexible approach that doesn't clog the system, and you can easily start an empty database for testing purposes in seconds.
There is an official image, mysql, of the MySQL database that you can find here: https://hub.docker.com/_/mysql. You can load and run the container using these images with the following command:
docker run -it --rm --name test-mysql -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=test -p 3306:3306 mysql
There are two necessary parameters that you can set with environment variables. First, the MYSQL_ROOT_PASSWORD environment variable sets a password for the root user. Second, the
Read now
Unlock full access