Illuminate\Database\QueryException : SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = pracatice and table_name = migrations)
Asked
Active
Viewed 49 times
0

apaderno
- 28,547
- 16
- 75
- 90

harshad tibile
- 11
- 3
-
2Does this answer your question? [Laravel SQLSTATE\[HY000\] \[2002\] Connection refused](https://stackoverflow.com/questions/41225720/laravel-sqlstatehy000-2002-connection-refused) – ᴄʀᴏᴢᴇᴛ Feb 19 '21 at 10:25
2 Answers
0
- First check the
composer require doctrine/dbal
is installed if this composer is not installed then install it - Check the database port number is correct or not with other information like
DB_HOST=127.0.0.1,DB_PORT=3307,DB_DATABASE=pracatice,DB_USERNAME=root,DB_PASSWORD=
- Check the files permission for project this is also most important for running
php artisan migrate
- Then retry
php artisan migrate

Miqayel Srapionyan
- 587
- 2
- 5
- 15

harshad tibile
- 11
- 3
0
In the .env file, try to change your DB_HOST from localhost
to 127.0.0.1
.

Ganesh Yawalkar
- 1
- 3
-
This won't help, localhost and 127.0.0.1 is the same thing. – Miqayel Srapionyan Feb 19 '21 at 12:39
-
Okay, please look at (https://stackoverflow.com/questions/35394230/sqlstatehy000-2002-connection-refused-within-laravel-homestead) – Ganesh Yawalkar Feb 19 '21 at 12:52
-