PDO connection error when using symfony and MAMP

前端 未结 4 2125
耶瑟儿~
耶瑟儿~ 2021-02-14 05:18

Getting an PDO error when trying to do php symfony doctrine:insert-sql
The error I get:

Warning: PDO::__construct(): [2002] Connection refused         


        
4条回答
  •  日久生厌
    2021-02-14 06:01

    I had the same error when attempting to build my tables in Symfony and using MAMP. I fixed the issue by changing my dsn line, in the databases.yml file, to the following:

    dsn: 'mysql:host=localhost;dbname=jobeet;unix_socket=/Applications/MAMP/tmp/mysql/mysql.sock'
    

提交回复
热议问题