2

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

6
  • Try dumping your parameters via console on the remote machine, that you can see if %database_host% has maybe the wrong values. I guess that capifony is already clearing the cache during deploys? Commented Sep 19, 2013 at 9:06
  • @m0c i'm on ssh on production server, usin php app/console i can't find how to dump parameters ? Commented Sep 19, 2013 at 9:15
  • 1
    The database server doesn't allow connections from the user apps and the machine 10.0.0.240 Commented Sep 19, 2013 at 10:21
  • php app/console container:debug --parameter=database_host Commented Sep 19, 2013 at 12:00
  • sorry @m0c, It says that "--parameter" option doesn't exist Commented Sep 19, 2013 at 12:09

1 Answer 1

1

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...

Sign up to request clarification or add additional context in comments.

1 Comment

@Pazi I have to wait 2 days ... but I will :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.