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

Community
  • 1
  • 1
mibbit
  • 4,997
  • 3
  • 26
  • 34

2 Answers2

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
Simon
  • 31,675
  • 9
  • 80
  • 92
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
ConAim
  • 61
  • 3