In this tutorial, we will go over the process of setting up and running MySQL and PostgreSQL databases using Docker Compose in a development environment. Docker Compose allows us to define container services for multiple versions of these databases in a YAML file, making it easy to create, configure, and manage them.

Here are the steps we will cover:

  1. Define a Docker Compose YAML file for a simple MySQL container.
  2. Test connecting to the containerized MySQL server using MySQL Workbench on the host OS.
  3. Test connecting to the containerized MySQL server database using another container.
  4. Test connecting to the containerized MySQL server database from within the container.
  5. Run multiple MySQL databases of different versions as containers.
  6. Configure volume mounts between the host OS and container to share the MySQL server configuration file.
  7. Configure volume mounts between the host OS and container to share the data directory.
  8. Manage containerized databases using a database management web tool, such as adminer.
  9. Run a containerized PostgreSQL database along with multiple MySQL databases.

By the end of this tutorial, you will have a solid understanding of how to use Docker Compose to set up and manage multiple MySQL and PostgreSQL databases in a development environment. This knowledge will enable you to create complex, multi-database applications with ease.