SadeghAlavizadeh
SadeghAlavizadeh

Reputation: 607

mongodb 3.2 :Error not authorized on admin to execute command on new installation

I just install mongodb 3.2 on my Windows 8.1 64bit and run the server with below command:

mongod --dbpath "d:\mongodb\data"'

and run mongo, when I try to create a new user for root access with below command, I get error,

db.createUser(
... {
... user: "admin",
... pwd: "1",
... roles: [ "root" ]
... }
... )

error below: mongodb 3.2 error in creating root user

Upvotes: 1

Views: 2600

Answers (2)

SadeghAlavizadeh
SadeghAlavizadeh

Reputation: 607

I can find my fault , I have Bitnami server in my Windows and when I run mongo command, in fact I connected to Bitnami mongodb instance.

I stop the Bitanmi and my problem solved.

Thanks

Upvotes: 1

Alex Blex
Alex Blex

Reputation: 37048

Ensure security.authorization is disabled in the config.

The doc says:

Add Users Before Enabling Access Control

Upvotes: 0

Related Questions