While running symfony jobeet tutorial, i got following error
fwh@pc11-desktop:~/web/jobeet$ php symfony doctrine:build-sql
>> doctrine generating sql for models
While exporting model class 'JobeetAffiliate' to SQL: PDO Connection Error: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)
fwh@pc11-desktop:~/web/jobeet$
This is fixed by editing config/databases.yaml
Find line
dsn: 'mysql:host=localhost;dbname=jobeet'
Replace with
dsn: 'mysql:host=localhost;dbname=jobeet;unix_socket=/var/run/mysqld/mysqld.sock'

One Response to Can’t connect to local MySQL server through socket