Reputation: 175
mongo connection failed in terminal every time after ubuntu startup then after running the command sudo service mongod start
it is working fine. I am using ubuntu 18.04. How to fix it that it may run always without the above command?
Upvotes: 1
Views: 106
Reputation: 76
Try below:
sudo systemctl enable mongod
Reboot your machine and check if the service is up.
sudo systemctl status mongod
Checking out the manpage will give you a lot of information.
See systemctl manpage
http://manpages.ubuntu.com/manpages/cosmic/en/man1/systemctl.1.html
Upvotes: 1