Description: Steps to find and access the MongoDB database on a DigitalOcean droplet.
-
Access the Droplet:
- Log into the droplet using SSH:
ssh [username]@[droplet_ip_address]
- Log into the droplet using SSH:
-
Check MongoDB Status:
- Ensure MongoDB is running:
sudo systemctl status mongod
- If not running, start MongoDB:
sudo systemctl start mongod
- Ensure MongoDB is running:
-
Access MongoDB Shell:
- Enter the MongoDB shell:
mongo
- Enter the MongoDB shell:
-
List Databases:
- Display available databases:
show dbs
- Display available databases:
-
Access a Specific Database:
- Switch to a database:
use [database_name]
- Switch to a database:
-
Check Collections:
- List collections in the database:
show collections
- List collections in the database:
Note: If there are issues accessing the database, check the MongoDB configuration file (/etc/mongod.conf) for the data directory or other configurations.