There may come a time when developing or managing a Monica instance that you would like to connect directly to the MySQL database being used.
For example you may want to
- alter test data
- generate custom metrics
- ...
- Stop your Monica and MySQL containers if they are running
- Bind port 3306 in your container to 3306 on your host machine
- Add
EXPOSE 3306:3306
to yourDockerfile
underEXPOSE 80:80
- Add a
ports
node undermysql
indocker-compose.yml
with a3306:3306
entry
- Add
- Start your containers with
docker-compose up
, wait for them to spin up - Connect to the database via a MySQL client (CLI, GUI, etc.)
You can install Sequel Pro from the website or via
brew cask install sequel-pro
if you have homebrew cask installed.
Connect to the database using the information in your .env
file.
In this example image we are using the default values.
If that is successful you are now connected and can execute queries, look at schemas, etc.