How to Get CouchDB Username and Password
Asked Answered
C

2

7

Unfortunately I forgot what my username and password is to login to CouchDB.

Here is a similar question.

I have looked within the local.ini file at C:\Program Files (x86)\Apache Software Foundation\CouchDB\etc\couchdb

password = somepassword
username = password

However I am unable to login through lclhst :5984/_utils/index.html login.

I have also tried the config.dat file at /opt/couchbase/var/lib/couchbase/config/config.dat

Are there other places where the username or password could be? It seems there is a hierarchy of files that take precedence over each other, though I could not find this in the docs.

Thanks

Cerebro answered 5/6, 2014 at 7:8 Comment(0)
J
14

Your server credentials are in the local.ini whose full path can be found using couchdb -c, in the [admins] section, but the password is hashed. It looks like this:

[admins]
username = -pbkdf2-70349775b6e7674de7fd45ff08675550046535c9,f18db0cd9fd933c0c610532e965ef1de,10

If you forgot the password, just replace the hash with your new password and restart CouchDB. It will be rehashed immediately. Example:

[admins]
username = newPassw0rd
Jabin answered 6/6, 2014 at 16:41 Comment(0)
P
1

relay from: http://silviud.blogspot.com/2012/10/couchbase-recover-web-console-password.html (Note: top 4 lines only)

/opt/couchbase/bin/erl \
-noinput -eval \
'case file:read_file("/opt/couchbase/var/lib/couchbase/config/config.dat") of {ok, B}  ->         io:format("~p~n", [binary_to_term(B)]) end.' \
-run init stop | grep cred
Philis answered 2/12, 2014 at 16:5 Comment(1)
I think this is for couchbase only. At least I could not find the config.dat here.Unhesitating

© 2022 - 2024 — McMap. All rights reserved.