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

前端 未结 12 2396
耶瑟儿~
耶瑟儿~ 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:51

    After seeing the answers and playing around with this myself I figured out the problem:

    The default installation of LAMPP, MAMPP has the following in the my.cnf file:

    skip-networking

    This means that mysql will not listen on TCP/IP so you can tell doctrine to try any port in the 64K and it won't do any good until you comment out the directive above and get mysql to listen to TCP/IP ports.

    Please ensure you restart LAMPP, MAMPP or reload mysql after commenting out the skip-networking directive.

提交回复
热议问题