我收到使用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
和控制台:
Kemal-Karakass-MacBook-Pro:~ kemalkarakas$locate MysqL.sock /private/var/MysqL/MysqL.sock
您可以在config.yml中使用参数unix_socket.
原文链接:https://www.f2er.com/php/131082.html查看完整配置示例:
# Doctrine Configuration doctrine: dbal: default_connection: default connections: default: driver: %database_driver% dbname: %database_name% user: %database_user% host: %database_host% password: %database_password% unix_socket: /tmp/MysqL.sock