Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database turned to 'default' when authentication is correct #295

Closed
asennoussi opened this issue Apr 28, 2015 · 3 comments
Closed

Database turned to 'default' when authentication is correct #295

asennoussi opened this issue Apr 28, 2015 · 3 comments
Labels

Comments

@asennoussi
Copy link

Hi !
This is my config :

doctrine_mongodb:
    connections:
        default:
            server: 'mongodb://localhost:27017,localhost:27018,localhost:27019'
            options:
                username: sshuichi
                password: complexpassword
                db: mydb 

When the password is not correct , I have this error :

Failed to connect to: localhost:27017: Authentication failed on
database 'mydb' with username 'sshuichi': auth failed; Failed to
connect to: localhost:27018: Authentication failed on database 'mydb'
with username 'sshuichi': auth failed; Failed to connect to:
localhost:27019: Authentication failed on database 'mydb' with
username 'sshuichi': auth failed

Please notice it's talking about mydb

When the password is correct, I have

not authorized on default to execute command

Why on earth is it talking about default this time ?

@sverraest
Copy link

It looks like the db value under options is ignored? Having the same issue.

@malarzm
Copy link
Member

malarzm commented Oct 6, 2016

If I'm not mistaken, db from connection is used for authentication, you can define database for your DocumentManager in its configuration and if absent, it fallbacks to default_database which defaults to default.

@malarzm
Copy link
Member

malarzm commented Oct 6, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants