axiomx11
axiomx11

Reputation: 710

Mongo: commandline admin auth fails

$ mongo
MongoDB shell version: 2.0.0
connecting to: test
> use admin
switched to db admin
> db.auth('admin', '******')
1

Then I can connect to other databases and run commands

Then I accidentally hit ctrl-C, so I try to login again.

$ mongo 
MongoDB shell version: 2.0.0
connecting to: test
> use admin
switched to db admin
> db.auth('admin', '******')
0

I can no longer auth against the admin collection. I assume this is because my previous login somehow didn't get cleared out, or is locked? How do I fix that?

Upvotes: 2

Views: 4968

Answers (1)

axiomx11
axiomx11

Reputation: 710

Found it! Just needed to get rid of the lock file. For me, this was here:

/ap/mongo/data/db/mongod.lock

Upvotes: 1

Related Questions