# DO - Databases

{{#include ../../../banners/hacktricks-training.md}}

## Basic Information

With DigitalOcean Databases, you can easily **create and manage databases in the cloud** without having to worry about the underlying infrastructure. The service offers a variety of database options, including **MySQL**, **PostgreSQL**, **MongoDB**, and **Redis**, and provides tools for administering and monitoring your databases. DigitalOcean Databases is designed to be highly scalable, reliable, and secure, making it an ideal choice for powering modern applications and websites.

### Connections details

When creating a database you can select to configure it **accessible from a public network**, or just from inside a **VPC**. Moreover, it request you to **whitelist IPs that can access it** (your IPv4 can be one).

The **host**, **port**, **dbname**, **username**, and **password** are shown in the **console**. You can even download the AD certificate to connect securely.

```bash
sql -h db-postgresql-ams3-90864-do-user-2700959-0.b.db.ondigitalocean.com -U doadmin -d defaultdb -p 25060
```

### Enumeration

```bash
# Databse clusters
doctl databases list

# Auth
doctl databases get <db-id> # This shows the URL with CREDENTIALS to access
doctl databases connection <db-id> # Another way to egt credentials
doctl databases user list <db-id> # Get all usernames and passwords

# Dbs inside a database cluster
doctl databases db list <cluster-id>

# Firewall (allowed IPs), you can also add
doctl databases firewalls list <cluster-id>

# Backups
doctl databases backups <db-id> # List backups of DB

# Pools
doctl databases pool list <db-id> # List pools of DB
```

{{#include ../../../banners/hacktricks-training.md}}



