-
-
Notifications
You must be signed in to change notification settings - Fork 659
Description
Have you already checked elsewhere?
- I have read the Devilbox documentation
- I have checked the Devilbox Troubleshooting Guide
- I have checked the Devilbox FAQ
- I have checked the Devilbox Howto
- I have checked the Devilbox Forum
- I have checked existing issues
- I have googled already with no luck
- I have not done any of the above
What are you struggling with?
OS / ENVIRONMENT:
Host operating system and version: MacOS Monterey 12.5.1
Docker desktop version: 4.12.0 (85629)
Docker desktop engine: Engine: 20.10.17
Docker desktop compose version: v2.10.2
I'm trying to connect the laravel app inside docker with MySQL on my host machine.
What have you tried already?
On my host machine MySQL is running is connected with following credentials.
Host OS MySQL
MySQL version: 8.0.27
Host: 127.0.0.1
Port: 3307
Password: No password
** Devilbox .env file:**
Expose MySQL Port to Host
HOST_PORT_MYSQL=3306
Laravel .env file
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=hanger
DB_USERNAME=root
DB_PASSWORD=
If i run docker-compose up -d php httpd mysql
everything work fine i'm able to connect to database via devilbox phpmyadmin.
As per the documentation https://devilbox.readthedocs.io/en/latest/corporate-usage/use-external-databases.html#database-on-host-os i ran this command docker-compose up -d php httpd bind
but i unable to connect to the database from inside the docker to host OS MySQL.
What is your goal?
I want to connect the laravel app in docker with MySQL on my host machine.