Skip to content

Howto: Use Another MySQL Instance

Jeffrey Boehm edited this page Sep 5, 2019 · 1 revision
  1. Remove the db service from docker-compose.yml, by removing the entire block.
  2. Remove the MYSQL_ROOT_PASSWORD variable from the .env file.
  3. Add a MYSQL_HOST variable to the .env file, change it so that it points to your MySQL host, 127.0.0.1 for example.
  4. Change MYSQL_DATABASE, MYSQL_USER, MYSQL_PASSWORD so they matches your credentials.
  5. Import the both .sql files in /db/rootfs/docker-entrypoint-initdb.d.

If your MySQL instance also runs in Docker, be aware that it needs to be connected to your mail network, since docker-compose creates a new one for each project. You can do so by executing for example docker network connect mail_default mysql.