bitpressio / docker-for-php-developers-errata

Reported errata for https://bitpress.io/docker-for-php-developers/
13 stars 0 forks source link

Connection Refused for default .env #13

Closed jayden-chua closed 5 years ago

jayden-chua commented 5 years ago

In Laravel (5.8) .env file for database configurations.

DB_HOST=127.0.0.1

Using 127.0.0.1 for DB_HOST will result in the following error when trying to run php artisan migrate for the first time.

SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations and table_type = 'BASE TABLE')

I think we can fix this if we use the name services. So in this case, in the video "06 - Laravel - Setting up MySQL" since, we named the MySQL service mysql we have to use mysql for the .env DB_HOST. Change DB_HOST=127.0.0.1 to DB_HOST=mysql.

jayden-chua commented 5 years ago

Sorry, just saw the Videos Errata link here https://github.com/bitpressio/docker-for-php-developers-errata/blob/master/video-course-errata.md

paulredmond commented 5 years ago

Hey no worries, it can get pretty confusing to follow errata sometimes 👍