0

I have set up the database on Mongodb Atlas and have connected to the database via application however it is not connecting to the database, I have tried using the Mongo shell also

I have tried to set up a new connection thinking it may be a corrupt file on my project but it still has the same issue. I also tried to run:

sudo apt update
sudo apt install -y mongodb
sudo systemctl status mongodb

but i get:

dpkg: error processing package mongodb (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mongodb-server
 mongodb

likewise if i try sudo service mongodb restart it then displays:

Tue Apr  2 21:16:28.214 Error: Invalid port number "//testdb-sc1hr.mongodb.net" in connection string "mongodb+srv://testdb-sc1hr.mongodb.net/cookbook" at src/mongo/shell/mongo.js:134
exception: connect failed

I have tried using sudo apt remove but i also get

invoke-rc.d: initscript mongodb, action "start" failed.
dpkg: error processing package mongodb-server (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mongodb:
 mongodb depends on mongodb-server (>= 1:2.4.1-2); however:
  Package mongodb-server is not configured yet.

Im very new to this and i feel like im just going round in circles now. I have also tried connecting with mongodb compass but it also displays "Authenication Failed"

Im not sure what else to try

rusne
  • 161
  • 1
  • 2
  • 5
  • Follow this link - https://stackoverflow.com/questions/30372596/unable-to-install-mongodb-on-linux – Ari7 Apr 02 '19 at 21:28
  • And this link - https://stackoverflow.com/questions/30691665/cant-remove-purge-unistall-mongodb-from-debian – Ari7 Apr 02 '19 at 21:33
  • thank you but using ```sudo service mongod start``` doesnt work its displays ```mongod: unrecognized service``` – rusne Apr 02 '19 at 21:39
  • What type and version of linux are you using? Also, try this [link](https://stackoverflow.com/questions/26852138/sudo-service-mongodb-restart-gives-unrecognized-service-error-in-ubuntu-14-0-4) – Ari7 Apr 03 '19 at 02:14

0 Answers0