0

When in Symfony I am trying to create the database via doctrine:database:create it throws the following exception:

[Doctrine\DBAL\Exception\ConnectionException]                                
 An exception occured in driver: SQLSTATE[08006] [7] FATAL:  database "tm_ootb" does not exist

Am I facing a bug or am I missing something in the configuration.

Here is my dbal config:

dbal:
    driver:   pdo_pgsql
    host:     "%database_host%"
    port:     "%database_port%"
    dbname:   "%database_name%"
    user:     "%database_user%"
    password: "%database_password%"
    charset:  UTF8
3
  • What is your doctrine:dbal config? Commented Oct 17, 2015 at 16:48
  • Possible duplicate of How to change a database to postgresql with Symfony 2.0? Commented Oct 17, 2015 at 17:50
  • @FelipeMorales you are far away from my question, I already have Postgres properly installed and configured. Commented Oct 22, 2015 at 23:57

1 Answer 1

0

Turns out that it is a Postgresql's permissions situation. Depending on the user level that you have configured on your parameters you will face this situation.

When connecting to Postgres with the postgres super user account that also owns the administrative data base called postgres, there is no problem at all because it issues the following command:

psql -U postgres

No problem because user and database exist, after that issues the 'createdb' command. But when using any other user that do not owns a data base or is not super user it throws the mention error. There should be a way to avoid such error with Doctrine.

Hopes this was useful for someone else.

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

Comments

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.