我收到类似使用 Symfony2 进行数据库操作的错误。
SQLSTATE[HY000] [2002] Connection refused
参数.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
和控制台:
Kemal-Karakass-MacBook-Pro:~ kemalkarakas$ locate mysql.sock
/private/var/mysql/mysql.sock
如何解决错误?