I installed successfully install Bitnami/Laravel
how to use MySQL in Docker?
I run localhost:3306 but it’s not running
any ideas
I installed successfully install Bitnami/Laravel
how to use MySQL in Docker?
I run localhost:3306 but it’s not running
any ideas
2
Answers
check your network, mysql container in same network with laravel container
and use container name for example mysql container name is db you can in laravel
env variables db:3306
Use the network name of MySQL in the
.env
file.For example, if the network name of MySQL is
mysql_docker
, add this to the.env
:Make sure you are using the correct port.
An example of MySQL configuration in the
docker-compose
: