logo image

show dbs failing on mongo console

> show dbs
2019-05-04T14:38:46.880+0000 E QUERY    [thread1] Error: listDatabases failed:{
	"ok" : 0,
	"errmsg" : "not authorized on admin to execute command { listDatabases: 1.0 }",
	"code" : 13,
	"codeName" : "Unauthorized"

1 Answer

9 months ago by

This looks like you need to authenticate first before listing dbs.

If you know the admin db password you can do the following

use admin 
db.auth("admin", "<password>");
show dbs
9 months ago by Megamind