This article is a mirror article of machine translation, please click here to jump to the original article.

View: 6300|Reply: 0

Linux correctly closes the mongodb database

[Copy link]
Posted on 8/3/2021 9:20:52 AM | | | |
Many tutorials on the Internet are to turn off mongodb by killing the process, with the following command:

The above method can indeed shut down mongodb, but it is definitely not the right way, because when the program is closed, there is also some code logic, such as the hard disk that persists the data, etc.

MongoDB provides a command to close the database, you first need to go to bin/mongo in the mongodb directory and connect to mongodb


Linux connects to mongodb via a shell terminal




Then execute the following script:



commandcan only run on mongodb servers,Or soAuthentication can only be performed remotely, otherwise the error will be as follows:



(End)





Previous:MYSQL 5.7.34 sets GROUP BY to display multiple columns
Next:Spring Cloud obtains the client IP address
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com