Answer the question
In order to leave comments, you need to log in
What is mysql connection error?
Good afternoon.
Mistake
SQLSTATE[HY000] [2002] Connection refused (SQL: select * from `users`)
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=33062
DB_DATABASE=lv-eliseev
DB_USERNAME=root
DB_PASSWORD=root
mysql:
image: mysql:5.7
restart: always
environment:
- "MYSQL_ROOT_PASSWORD=root"
volumes:
- "./docker/mysql:/var/lib/mysql"
ports:
- "33062:3306"
php artisan migrate
and the tables were created. Answer the question
In order to leave comments, you need to log in
DB_HOST=mysql
DB_PORT=3306
I ran php artisan migrate and the tables were created.Stop executing commands on the host - all work must be done in containers, otherwise there is no point in using them.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question