0 votes
in MongoDB by
How do we create a database in MongoDB?

1 Answer

0 votes
by

When I want to create a database in MongoDB, I faced the following error:

 :~$mongo

MongoDB shell version:1.65

Connecting to: test

Error: Could not connect to the server

Exception: connect failed

The solution to the above error:

cd/var1/lib1/MongoDB

We remove the mongod. lock from the folder

Sudo start MongoDB

Mongo

...