Answer the question
In order to leave comments, you need to log in
Laradock (Docker) - Can't run migrations - SQLSTATE[HY000] [2002] Connection refused - what to do?
Installed Laradock (Docker Compose configured for Laravel).
I go into the box:
docker-compose exec workspace bash
I go to the folder with Laravel, run migrations, I get this:
[email protected]:/var/www/project1# php artisan migrate
Illuminate\Database\QueryException
SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = default and table_name = migrations and table_type = 'BASE TABLE')
### MYSQL #################################################
MYSQL_VERSION=latest
MYSQL_DATABASE=default
MYSQL_USER=default
MYSQL_PASSWORD=secret
MYSQL_PORT=3306
MYSQL_ROOT_PASSWORD=root
MYSQL_ENTRYPOINT_INITDB=./mysql/docker-entrypoint-initdb.d
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=default
DB_USERNAME=default
DB_PASSWORD=secret
docker-compose exec mysql mysql -u root -proot
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question