Want to start mongodb but facing this kind of error'mongo' is not recognized as an internal or external command, operable program or batch file' [duplicate] - mongodb

This question already has answers here:
mongo.exe not installed in Version 6.0.0
(7 answers)
Closed 3 months ago.
I'm trying start mongo in cmd:
C:\Users\Vishal Bramhankar>mongo
'mongo' is not recognized as an internal or external command,
operable program or batch file.
What I missed here?

After MongoDB version 6.0 and onwards we need to install MongoDB Shell separately.
Configure below path in envarinment variables
C:\Program Files\mongosh-1.6.1-win32-x64\bin
Close your cmd and open the new cmd again and run below command:
C:\Users\Vishal Bramhankar>mongosh
Run below one for knowing DBs:
test> shows dbs
MongoDB shell installation:
https://www.mongodb.com/try/download/shell

Related

Can't run mongo command on windows [duplicate]

This question already has answers here:
mongo.exe not installed in Version 6.0.0
(7 answers)
mongosh is a valid command but mongo is not found
(2 answers)
Closed 13 days ago.
I tried t to set up Community MongoDB on my windwos pc. I followed the installation process and tried to set up the environment variables. I copied the pathes from my explorer, so the pathes should be correct. screenshot of my env
Nonetheless I can't use any mongo commands on my command shell. Anytime I try to run "mongo" or "mongodb" or "mongo --version" it says "command is either misspelled or couldn't be found". screenshot of my cmd shell
When I use the command "mongod" some strange code appears screenshot of my cmd shell
How can I solve this problem?
Found the solution: you have to set up mongoshell first and then you can use the command "mongosh" to use it with the windows command. This tutorial helped me set everything up: youtube.com/watch?v=V-d6VAYrjeQ

After setting variable showing this error again 'mongo is not recognized as an internal or external command, operable program or batch file

I have installed mongodb and put a path in environment variable.When i use cmd it still throwing error which is 'mongo' is not recognized as an internal or external command,
operable program or batch file.
enter image description here
enter image description here
The mongo executable is deprecated and no longer available in 6.0.
Keep in mind this is just the shell, mongod is the binary that runs the database.
mongosh is the new shell.
Look in C:\Program Files\MongoDB\Server\6.0\bin to see the binaries that exist.

Mongodb command not recognized

I am learning a mongodb tutorial and I'm new to it and I tried executing mongodb commands but the cmd is showing
C:\Users\paanc_ctx7xp6>mongod --version
'mongod' is not recognized as an internal or external command,
operable program or batch file.
although I added path variable it still isn't working. I even tried adding "" after bin but anything I have done isn't working at all , and I can't seem to get an answer because everyone is simply saying to edit path variable. Can someone please help me
path variable
cmd

How do i run mongo shell outside my installation directory?

Whenever I run mongo on command line i get
'mongo' is not recognized as an internal or external command,
operable program or batch file.
I'll have to change to my directory first to run mongo shell, which is pretty deep in my directory.
How do can I run mongo shell without changing my directory?

How do I know which MongoDB version is installed by using the Command Line?

Without changing directory to \MongoDB\bin\, when I call:
mongod -v
I get:
'mongod' is not recognized as an internal or external command, operable
program or batch file.
When I call the same command from \bin\ it launches the server just like I'm calling:
mongod
It is the same case with 'mongo' and 'mongos'.
I added the \bin\ path to the environment variables thinking it will help but it didn't.
To clarify with an example, to get the version of Ruby, I can call:
ruby -v
Why can't I do the same with MongoDB?
First add location of MongoDB's bin folder to PATH env variable. This is required because it is the place where mongod.exe is stored.
For example, if MongoDB 4.0 is in your Program Files, add "C:\Program Files\MongoDB\Server\4.0\bin" to PATH for all system users.
Then try using :
mongod --version