Symfony 2 SQLSTATE[HY000] [2002] Connection refused Error

前端 未结 12 2386
耶瑟儿~
耶瑟儿~ 2020-12-15 07:31

I get an error like database operations using Symfony2.

SQLSTATE[HY000] [2002] Connection refused

parameters.yml

parameters         


        
12条回答
  •  佛祖请我去吃肉
    2020-12-15 07:42

    If anyone is still stuck on this issue when using a virtual environment, I found if you are attempting to run database commands on the host machine and running into the "connection refused" error, try ssh-ing into your guest machine and running the commands directly so the path to mysql.sock is correct.

    (I guess it makes sense that the relative path needs to be on the virtual guest machine, not the host machine).

提交回复
热议问题