When i Access Mongodb from the cmd using mongosh command, it returns Access Denied

20 views Asked by At

I intsalled MongoDB on my windows 11 computer, but when i run mongosh in my cmd it returns access denied

>mongosh access Denied

this is what appears when i run the command

i tried uninstalling and reinstalling and adding it to the environment variables. C:\Program Files\MongoDB\Server\7.0\bin

2

There are 2 answers

0
Ravi Yadav On

You can run this by enabling Compatibility mode of mongosh exe file. Check this post for detailed answer: https://answers.microsoft.com/en-us/windows/forum/all/this-app-cant-run-on-your-pc/f94db755-9416-470a-9532-de9dc6ec53d2

0
Alfred owino On

I realised that i dint have a mongosh file in my bin folder(user/programfiles/mongo/server/bin/), so i had to download the mongoshell. you can download it from here. then after downloading it extract it and then go to the bin folder of the newly downloaded mongoshell and copy the path of the bin folder, then add it to the environment variaboles, restart your terminal and vwalla!