Skip to content

Commit 3e4a5ed

Browse files
authored
Merge pull request laradock#407 from michaeljhopkins/patch-2
Add solution to mysql connection issues
2 parents 3f157a3 + 9289c1b commit 3e4a5ed

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,8 +1357,11 @@ Make sure the ports for the services that you are trying to run (80, 3306, etc.)
13571357

13581358
This error is sometimes happens because your Laravel application isn't running on the container localhost IP (Which is 127.0.0.1). Steps to fix it:
13591359

1360-
1. Check your running Laravel application IP by dumping `Request::ip()` variable using `dd(Request::ip())` anywhere on your application. The result is the IP of your Laravel container.
1361-
2. Change the `DB_HOST` variable on env with the IP that you received from previous step.
1360+
* Option A
1361+
1. Check your running Laravel application IP by dumping `Request::ip()` variable using `dd(Request::ip())` anywhere on your application. The result is the IP of your Laravel container.
1362+
2. Change the `DB_HOST` variable on env with the IP that you received from previous step.
1363+
* Option B
1364+
1. Change the `DB_HOST` value to the same name as the mysql docker container. The Laradock docker-compose file currently has this as `mysql`
13621365

13631366

13641367

0 commit comments

Comments
 (0)