I have spent a majority of my day trying to add a user to mongodb 2.6.5. I installed & re-installed Mongo via macports.
Try #1 ( addUser();
):
1. # switching to the admin user
> use admin
2. # db.addUser("admin", "password");
When use the addUser();
I get this error:
WARNING: The 'addUser' shell helper is DEPRECATED. Please use 'createUser' instead
2014-11-03T15:19:16.193-0500 Error: couldn't add user: User and role management
commands require auth data to have schema version 3 but found 1 at src/mongo/shell/db.js:1004
Try #2 ( createUser();
):
1. # switching to the admin user
> use admin
2. # db.createUser("admin", "password");
When use the createUser();
I get this error:
2014-11-03T15:25:38.243-0500 Error: couldn't add user: no such cmd: 0 at src/mongo/shell/db.js:1004
I have spent a lot of time looking up other people's questions and answers. Does anyone know how to fix this?