Laravel не может подключиться к mysql в laradock на docker. Как мне это исправить? вот .env в laravel проекте
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=dcl
DB_USERNAME=developer
DB_PASSWORD=mysql
.env в laradock
### MYSQL #################################################
MYSQL_VERSION=latest
MYSQL_DATABASE=dcl
MYSQL_USER=developer
MYSQL_PASSWORD=mysql
MYSQL_PORT=3306
MYSQL_ROOT_PASSWORD=mysql
MYSQL_ENTRYPOINT_INITDB=./mysql/docker-entrypoint-initdb.d
mysql> показать базы данных; + -------------------- + | База данных | + -------------------- + | Dcl | | информационная схема | | mysql | | performance_schema | | системный | + -------------------- + 5 строк в наборе (0,00 se c)
mysql>
$ docker-compose exec workspace php artisan migrate
Illuminate\Database\QueryException : SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = cleaning and table_name = migrations and table_type = 'BASE TABLE')
at /var/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:669
> 669| throw new QueryException(
Exception trace:
1 PDOException::("SQLSTATE[HY000] [2002] No such file or directory")
/var/www/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70
2 PDO::__construct("mysql:host=localhost;port=3306;dbname=dcl", "developer", "mysql", [])
/var/www/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70