9db75894d3
* Add a file documenting how to connect to the MySQL database in a Docker container * Link to docs/database/connecting.md from the main readme and the docker setup instructions
1.2 KiB
1.2 KiB
Connect to MySQL inside of a Docker container
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:3306to yourDockerfileunderEXPOSE 80:80 - Add a
portsnode undermysqlindocker-compose.ymlwith a3306:3306entry
- 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.)
Sequel Pro (macOS)
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.

