How do I connect to a database in Docker

I Use VSCode Remote Containers development, how do I connect to a database in Docker using MySQL Workbench/DataGrip

Refer this post for MySQL workbench

  • With this? How do I map ports from Docker

Publish ports Compose specification | Docker Documentation

Edit the docker-compose.yml from .devcontainer directory.

![sql|690x247]
I did this and this

It still doesn’t work Is it left somewhere?

I don’t know about windows. I’ve not used windows or mac with docker.

On windows one of the setup method needs virtualbox ports to be forwarded on to host machine.

I have the same problem with Ubuntu

publish port 3306 of mariadb service and not frappe service.

Thank you very much