Illuminate database QueryException: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: name cannot be resolved (SQL: select * from
Table name
)
The tests run in the container but are broken in the IDE. Do you know what the problem is in PhpStorm?
P粉1547981962023-11-02 18:26:28
I encountered this problem. Assuming you've set up a Docker container and a PHP interpreter, this is how I connected to the MySQL container:
docker network ls
from the CLI and see the "lighthouse_default" networkObviously the network name may be different in your case. The real point is that I have to make sure I'm using the correct network and make sure the database image is in the container link.