I get an error like database operations using Symfony2.
SQLSTATE[HY000] [2002] Connection refused
parameters.yml
parameters:
database_driver: pdo_mysql
database_host: 127.0.0.1
database_port: '8889'
database_name: symfony
database_user: root
database_password: root
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: null
mailer_password: null
locale: tr
secret: ef9b4381fe75208f060b7c786951242bebcfb3c2
database_path: /private/var/mysql/mysql.sock
And console:
Kemal-Karakass-MacBook-Pro:~ kemalkarakas$ locate mysql.sock
/private/var/mysql/mysql.sock
How do I resolve the error?
127.0.0.1:8889
with username/passwordroot:root
? The default MySQL port3306
btw. – Germinatedatabase_path
directive - do you want to connect through127.0.0.1:8889
or the socket? If you want to use the socket - did you configure MySQL to use this socket location and tried connecting through it aswell? – Germinate'
around your port :) – Germinate