3
votes

I have created an admin level user and given the dbAdminAnyDatabase, userAdminAnyDatabase, readWriteAnyDatabase permissions on the admin database as well as my other database and I can create a successful connection to the client but when I try to run a command to retreive data I get an error saying 'Command find failed: not authorized on {database} to execute command'.

Any ideas on why this isn't working?

1
need more info and details. but I guess when you mongo to the database, you need to add --authenticationDatabase option, such as mongo -u foo --authenticationDatabase admin -p ......BAE

1 Answers

-1
votes

I found an example where the user was made to have "root" access and now I can successfully query data. The question still remains why the above credentials didn't work.