I build 2 docker container with docker-compose. I use Docker on Mac, no boot2docker.
version: \'2\'
services:
drupal-web:
image: drupal:
Map host port 4306 (or any other available port) to docker mysql 3306 like:
mysql-server:
image: mysql
environment:
MYSQL_DATABASE: drupal
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: drupal
MYSQL_PASSWORD: drupal
ports:
- "4306:3306"
You should be able to connect to docker mysql with 127.0.0.1:4306
mysql -u drupal -h 127.0.0.1 -P 4306 -p