0x1gene
0x1gene

Reputation: 3458

Symfony2 can't connect to remote database

My web application (on ip 10.0.0.240) should connect to a remote database (10.0.0.245) but it try to connect on local's IP (10.0.0.240)

parameters:
    database_driver: pdo_mysql
    database_host: 10.0.0.245
    database_port: null
    database_name: apps
    database_user: apps
    database_password: ******

I double check in config file I have :

doctrine:
    dbal:
        driver:   %database_driver%
        host:     %database_host%
        port:     %database_port%
        dbname:   %database_name%
        user:     %database_user%
        password: %database_password%
        charset:  UTF8

I took this settings from a existing application of mine working just fine... but here I have constant error :

SQLSTATE[28000] [1045] Access denied for user 'apps'@'10.0.0.240' (using password: YES)

If I try to connect from my local machine it works... I'v deploy my project using capifony I'v check on current/app/confif/parameters.yml and share/app/config/parameters.yml they are the same and they are good ...

EDIT

I'm using symfony 2.2.6

Upvotes: 2

Views: 2979

Answers (1)

0x1gene
0x1gene

Reputation: 3458

It appears that my user(apps) was not allowed to connect from 10.0.0.240

Pazi was right after all !

It was due to missunderstanding of msql error message

I've change the privilege for apps user to connect from 10.0.0.240 and everything works fine...

Upvotes: 1

Related Questions