Indeed, this is not so easy, and that’s on purpose: exposing a database port on the host would create security vulnerabilities and eventual port conflicts. Your best bet is to add a docker-compose.override.yml
file to $(tutor config printroot)/env/local/
. This file would contain something like:
version: "3"
services:
mysql:
ports:
- "3306:3306"
You would then be able to connect to your database on port 3306 with the root password given by tutor config printvalue MYSQL_ROOT_PASSWORD
.
Note that I did not test this personally, but it should work.