Getting "mongo is not recognized as an internal command"

Hey folks!

Even after setting up the system environment variable path, I am still getting the error that “mongo is not recognized as an internal command”. Please Help!!

Please check your env. variable PATH again
Are you able to invoke mongo by giving full path?
Also paste the screen shot

Hi @Atul_86401,

As I can see in other threads, your path is set now and you are able to run the mongo command. If you have any other query feel free to get back to us.

Happy Learning :slight_smile:

Thanks,
Shubham Ranjna
Curriculum Support Engineer

Hi @Shubham_13709,

Yeah, my path is set but I am still getting the same error.

I’ve tried using both the shell options earlier version and latest version

This is by copying the connection string with latest version option.

This is by copying the connection string with older version option.

Hi @Atul_86401,

I am able to connect to your cluster. Please make sure you are not behind a firewall or using VPN connection. Try to ping your cluster by executing this command in the terminal.

ping sandbox-shard-00-00-fpurq.mongodb.net

Please share the screenshot of the response.

Thanks,
Shubham Ranjna
Curriculum Support Engineer

Hey @Shubham_13709

Did that, I am getting this

I tried connecting again and it’s still giving error.

Hi @Atul_86401,

Please try to connect using this connection string.

mongo “sandbox-shard-00-00-fpurq.mongodb.net:27017” --ssl --authenticationDatabase admin -u m001-students -p m001-mongodb-basics

Thanks,
Shubham Ranjna
Curriculum Support Engineer

Hi Atul_86401,
try this command:

mongo "mongodb+srv://sandbox-fpurq.mongodb.net/test" --authenticationDatabase admin --ssl --username m001-student --password m001-mongodb-basics

Also remember to allow connections to cluster from all IP addresses (being in CONTEXT M001 go to Security > Network Access > IP Whitelist and add 0.0.0.0/0).

But with such query he will connect only to the first server in cluster. Am I right?

Yes your instincts are correct. It is just to test if he is able to reach any node of the replica set or not.

Thanks,
Shubham Ranjna
Curriculum Support Engineer

@Shubham_13709

Hey,

I am still getting connection failed.

@Adam_96833

Hey,

Tried this also :face_with_head_bandage:

Hi @Atul_86401,

Please refer this post. Let me know if you are not able to connect from any other network as well.

Thanks,
Shubham Ranjna
Curriculum Support Engineer

@Shubham_13709

Yeah I am using my office’s computer. I will try it after getting home and will share the results.

Thanks! :slight_smile:

Hey @Shubham_13709,

It’s working fine in my pc. Thanks for the help. :slight_smile:

Hi @iamaeytee,

It’s a wonderful news that you are able to connect to your cluster. If you ever get stuck in any other topic, please feel free to get back to us.

Happy Learning :slight_smile:

Thanks,
Shubham Ranjan
Curriculum Support Engineer

1 Like