10

I am beginner lift with django mongodb on heroku [ addon : mongolab ].

heroku run python manage.py syncdb

Running python manage.py syncdb attached to terminal... up, run.2332 Creating tables ...

OperationFailure: database error: not authorized for query on database.system.namespaces consider editing privileges on the basis of data mongo

.

>use admin
>db.addUser({ user: "myadmin", pwd: "1234", roles: ["userAdminAnyDatabase"] })

but get:

Error: couldn't add user: not authorized on admin to execute command 

Thanks in advance.

2
  • Deployment heroku test this in here: link ,but the error comes in: link , local works well the problem is generated in heroku deployment . Commented Jun 4, 2015 at 4:08
  • How did you log to the mongo shell? You need to authenticate with a privileged user. Commented Apr 21, 2016 at 14:37

3 Answers 3

1

Heroku Postgres does not allow for user creation. You'll want to use the connection string provided in DATABASE_URL. Actions like creating/dropping DB's and creating users is prohibited.

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

Comments

0

I think this is more a heroku problem than a django problem. It appears to be that you're not allowed to add users on the mongodb instance; were you send a username and password to plug into the django settings?

Comments

0

First you should connect to your mongodb terminal without any authentication, then you try to create user or user-role which you want to do.

check this link for more information. here

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.