Anurag Dhote
Anurag Dhote

Reputation: 537

mongo.exe not installed in Version 6.0.0

I installed MongoDB community Server from this link. But when I look into C:\Program Files\MongoDB\Server\6.0\bin , I am not able to locate mongo.exe file. I am able to see mongod.exe and mongos.exe. Can someone help. Thank you.

Upvotes: 42

Views: 55880

Answers (14)

Sanan Ali
Sanan Ali

Reputation: 3407

After spending an hour, I came to know that mongodb version 6+ doesn't have mongosh and you have to install it manually.

  1. Go to here and download the zip file.
  2. Extract the zip file and then copy the folder to MongoDB server folder or somewhere else
  3. Copy the path and add to environment variable
  4. Run mongosh from command prompt.

Upvotes: -1

VIKAS KUMAR
VIKAS KUMAR

Reputation: 1

You are saving below something like:
alias mongod="/c/Program\ files/MongoDB/Server/4.0/bin/mongod.exe"
alias mongo="/c/Program\ Files/MongoDB/Server/4.0/bin/mongo.exe"

But since in updated version some changes are made so you need to do some changes as well like this:
alias mongod="/c/Program\ files/MongoDB/Server/your current version(example: 5.0 or 6.0 or 6.1 etc)/bin/mongod.exe"
alias mongo="/c/Program\ Files/MongoDB/Server/your current version(example: 5.0 or 6.0 or 6.1 etc)/bin/mongos.exe"
=====> just change bold text with your old one(that is in mongo.exe's s like mongos.exe and your version only means mongo.exe to mongos.exe and your latest version what you've downloaded)

Upvotes: -2

Hamas Sohail
Hamas Sohail

Reputation: 27

mongo.exe doesn't come in version 6.0+ with a community package. However, you can follow through to use Mongo with Mongosh (Mongo Shell) + you can also use mongosh with Hyper

  • First, download and install Mongo shell from this link.

  • Then extract the file and place them in program files. (Note the path)

  • Now you have to create an environment variable. open the "Edit the system environment variable" window. Here is the screenshot

  • Now click on environment variables. Screenshot

  • Now click on edit under System variablesScreenshot

  • Paste the path of the Mongo shell to set up the environment.

Now Set up Using Hyper

  • Run cd ~ to go to the root directory in Hyper.

  • Then run touch .bash_profile. to create the file.

  • After that Run " vim .bash_profile" to open the file and press "i" to insert path.

  • Now enter the following path "alias mongsh="/c/Program\ Files/MongoDB/mongosh/bin/mongosh.exe" (Make sure to replace the path with the installation path for mongosh.exe in your computer)

  • Now run the command mongosh in Hyper to check the installation. Installation Successful

Upvotes: 1

Just install mongosh (mongo shell) from MongoDB site mongoDB site , after installing unzip the file and go to bin folder and copy the mogosh file and paste in the directory where your all mongo file is stored( MongoDB -> server -> 6.0 -> bin ). after this open cmd and rum mongosh command. it will successfully run.

Upvotes: 0

for mongo db
for mongo db

Reputation: 1

if you download mongoDB version<6.0 then  command for mongo shell is (mongo)
if you use mongoDB version>6.0 then command for mongo shell is (mogosh)
but you must be place inside mongoDB  download folder (mongosh.exe) file
https://downloads.mongodb.com/compass/mongosh-1.8.0-win32-x64.zip
and after download you  must be keep extract the zip file and keep 
mongosh.exe file inside mongoDB folder bin file.

Upvotes: -2

kisuke_urahara
kisuke_urahara

Reputation: 37

download mongo shell from https://www.mongodb.com/try/download/shell downloading and unzip the bin directory copy the files in the original bin directory from Mongodb folder, and run mongod.exe open a new tab and run mongosh.exe which worked for me.

Upvotes: -2

Moin
Moin

Reputation: 11

You can open the InstallCompass.ps1 PowerShell script to install MongoDB Compass (which includes an embedded version of mongosh, the new MongoDB Shell) or download the MongoDB Shell from the the MongoDB Download Center

Upvotes: 1

Sachin Kumar
Sachin Kumar

Reputation: 11

You also need to add a path variable of the bin folder where mongosh application is present (after downloading from the below link:
https://www.mongodb.com/try/download/shell ).

Then you can use mongosh command from anywhere using CMD:

screenshot where mongosh is present

Upvotes: 0

Kumawat Lalit
Kumawat Lalit

Reputation: 560

STEPS TO FOLLOW AFTER DOWNLOADING SHELL FROM https://www.mongodb.com/try/download/shell

Include both your mongosh shell and mongod in environment variables.

  1. go to your c drive and create db folder inside data folder

  2. then run your mongosh and mongod in two different cmd windows separately

    ..first run mongod ..then run mongosh

  3. if you have check-marked run as a service at the time of download then next time you are not required to start mongosh , it will automatically get started.

Upvotes: -2

Wernfried Domscheit
Wernfried Domscheit

Reputation: 59436

It should be noted, that in MongoDB version 6.0 there are two items:

  • The legacy mongo shell is removed from MongoDB 6.0
  • The MongoDB Shell (mongosh) is not installed with MongoDB Server. You need to follow the mongosh installation instructions to download and install mongosh separately. This was already announced in MongoDB version 5.0

The legacy mongo shell does not exist anymore on MongoDB version 6.0. If you desire the old mongo.exe, then you can install if from an earlier MongoDB version.

Upvotes: 2

dododo
dododo

Reputation: 4877

legacy mongo shell (mongo) no longer ships with server binaries (for servers >= 6.0). You can download a new shell version (mongosh) from here

Upvotes: 52

Larry
Larry

Reputation: 678

After version 6.0.0 mongo.exe does not get installed to your bin folder so you have to manually install the new MongoDB shell which is called mongosh then you have to add its path to your system variables and then run mongosh --version to see if it got installed. Afterwards if you want to create your own databases and preform operations run "mongosh" in your terminal to connect to a MongoDB instance running on your localhost with default port 27017.

Read the mongoDB documentation for more information:

Upvotes: 5

Dharmil Shah
Dharmil Shah

Reputation: 49

To run the Mongo Shell , Download msi package from the MongoDB Community Download - https://www.mongodb.com/try/download/community The version 6.0 do not ships with server binaries so mongo.exe file wouldn't be shown. So instead download mongo shell - https://www.mongodb.com/try/download/shell After downloading unzip the bin directory in your Original bin directory (You would also need to create a new directory in C: drive named data/db) Now open the bin directory from Mongodb folder, and run mongod.exe After that keeping Mongod.exe running in background open mongosh.exe , Your mongo Shell will be started.

Upvotes: 3

VISHNU SANTHOSH
VISHNU SANTHOSH

Reputation: 528

Answer from dododo worked for me.

  1. Download Mongo Shell - mongosh from MongoDB Download Center
  2. Extract the contents of the bin from the downloaded zip file to the bin file of your MongoDB folder and run mongosh instead of mongo.

Upvotes: 31

Related Questions