A few days back, when I installed the MongoDB and start the MongoDB server by using the “mongo” command, I got the error “mongo is not recognized as an internal or external command“.

In this MongoDB tutorial, we are going to resolve this error Mongo is not recognized as an internal or external command. These are the following topics that we are going to cover in this tutorial:
- mongo is not recognized as an internal or external command
- mongo-connector is not recognized as an internal or external command
- mongo_url is not recognized as an internal or external command
- Use is not recognized as an internal or external command
mongo is not recognized as an internal or external command
This error usually occurs because the system can not find the executable that you are asking to launch so to launch the file you have to provide the full path and after that, it will run without any issues.
This error comes because after installing the MongoDB database we also need to set the path of MongoDB in the system environment variable.
So to resolve this error you need to follow the below steps:
- Open that folder where you install MongoDB
- Open MongoDB folder till bin folder where mongod.exe file and copy the path
C:\Program Files\MongoDB\Server\5.0\bin>

- Now, open “edit the system environment variable” and click on Environment Variables button.

- A new window is open, goto System Variables click on path and click on Edit button.

- Again open a new window, click on new button and paste the above path here.

- After that click on OK button and your MongoDB path is successfully saved into your system.
- Now start the MongoDB server

Now see, we successfully resolve the error and we can start the MongoDB server without any error.
You may also like reading the following articles.
- MongoDB join two collections
- Unable to locate package mongodb-org
- Import CSV into MongoDB
- MongoDB create and change user password
- MongoDB group by multiple fields
- MongoDB failed to connect
- MongoDB drop collection
- Sub-process /usr/bin/dpkg returned an error code (1)
- Import JSON and insert JSON into MongoDB
- MongoDB backup and restore
- MongoDB two-phase commit
- How to drop a database in MongoDB
In this tutorial, we have resolved the error “MongoDB is not recognized as an internal or external command“. These are the following topics that we covered in this tutorial
- mongo is not recognized as an internal or external command
- mongo-connector is not recognized as an internal or external command
- mongo_url is not recognized as an internal or external command
- use is not recognized as an internal or external command
I am Bijay having more than 15 years of experience in the Software Industry. During this time, I have worked on MariaDB and used it in a lot of projects. Most of our readers are from the United States, Canada, United Kingdom, Australia, New Zealand, etc.
Want to learn MariaDB? Check out all the articles and tutorials that I wrote on MariaDB. Also, I am a Microsoft MVP.