0

I'm developing a web site with Symfony2.

I tried to switch from the 'dev' environment to 'prod'. But when I connect me with correct identifiers (in the database), I have a database connection error : "SQLSTATE[HY000] [2002] Connection refused".

Whereas I don't have any error when I test this connection with the "dev" environment on the same server and with the same database.

What it can cause this error ?

Do you have an idea ?

Thank you

Benjamin BD
  • 161
  • 1
  • 3
  • http://stackoverflow.com/questions/19629932/symfony-2-sqlstatehy000-2002-connection-refused-error – Philo Sep 10 '15 at 17:29
  • I already saw this post but nothing works. My situation : Local server, dev : connection works; Local server, prod : connection works; Web server, dev : connection works; Web server, prod, connection doesn't work; – Benjamin BD Sep 10 '15 at 18:10
  • The only thing that can cause this is that there are differences in your connection settings. In which file have you defined the connection settings? – Steve Childs Sep 11 '15 at 00:08
  • In the file parameters.yml : parameters: database_host: host.com database_port: port database_name: name database_user: user database_password: password – Benjamin BD Sep 11 '15 at 06:14
  • And in the config.yml : doctrine: dbal: driver: "pdo_mysql" host: "%database_host%" port: "%database_port%" dbname: "%database_name%" user: "%database_user%" password: "%database_password%" charset: UTF8 unix_socket: /tmp/mysql.sock – Benjamin BD Sep 11 '15 at 06:19

0 Answers0