Category: Database, Data, Docker, yaml

You'll learn how to set up MySQL container for your local development using docker compose. You can easily start it and shut it down when you don't need it and your data won't get lost.

You can put any sql file into ./db/sql directory, it will run automatically when during build.

You will be able to connect to your database called test, on your localhost port 3306, with the user named docker using the password docker.

You will find your data is still available after you shut down and start your container again, since we specify volumes in our docker compose yaml file.

Related Articles