0
I had my Laravel environment working at XAMPP. However, given some needs, I had to switch to Docker. For that, I started using Laradock. However, I only want to run php and apache on Docker and not the database, because I want to use the old database (from XAMPP).
Therefore, I have a container of the Laravel running on my computer, so far so good, but when I try to enter the site through the browser, I find the following error:
I imagine the reason for this error is that the container cannot access mysql running on my machine at port 3306, because the credentials in . project env are correct. But I think I’m wrong in this. Anyway, someone can help me?
I can use the database installed on my machine or I will have to create a new one with the command docker-compose up -d mysql
?
I found in this reply. You need to change the value of the DB_HOST variable in the . env file of your project. Then I changed from "127.0.0.1" to "host.docker.Internal"
– Cristian Benites