Mongo command not found

mongo comman not found

Hi @Prajwal_Janbandhu and welcome to the MongoDB community.

This portion of your screenshot looks to provide some answers:

Did you update your $PATH variable as recommended? If you did, do you see the path mentioned?

MongoDB 6.0 was recently released. Is there a reason you’re using MongoDB 4.4? While 4.4 will be supported for about 6 more months, would it make sense for you to upgrade to a newer version of the database to get the most recent security updates and features?

1 Like

i had installed version 5.0 and also i want to run the mongod but it’s showing this error i had included the path also.

sudo export PATH=$PATH:/usr/local/Cellar/mongodb-community@5.0/5.0.10/bin
this path i have uploaded in bash profile and i have tried to open the executable file from that path but the same error occurs. please help regards with this.

You might have installed mongod as service
When you issued mongo looks like it did connect to default mongod running on port 27017
Just connect and issue db,show dbs
You don’t have to start mongod again
That may be the reason it is not allowing mongod to come up as you already have a mongod up and running

The error in your log file states that the mongod process cannot unlink the file /tmp/mongodb-27017.lock because permission is denied. My guess here is that the file is owned by the root user. You can check that by running ls -alh /tmp/mongodb-27017.lock.

To correct this issue, you can delete the file sudo rm /tmp/mongodb-27017.lock and then start the mongod process once more, which will recreate the file.