> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prod.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Database connections

Prod AI integrates with popular databases so your team can build apps and agents directly on top of your company's data. Using centralized authentication and network settings, administrators govern how builders and apps connect to each database.

## Connection method

When connecting to databases in Prod AI, you typically have two options:

### Connection form

Connect by filling out a form with your database host, port, database name, and credentials. Connection forms use standard `username/password` authentication. If you need advanced parameters or custom connection options, use a [connection string](#connection-string).

### Connection string

Connect using a connection URI to pass arbitrary parameters for custom setups. The expected URI format varies by database:

| Database | String format | Docs |
| - | - | - |
| Amazon Redshift | `redshift://[:username]:[:password]@[:host]:[:port]/[:database]` | [Docs](https://docs.aws.amazon.com/redshift/latest/mgmt/jdbc20-build-connection-url.html) **Note**: Exclude the `jdbc` prefix from the connection string |
| CockroachDB | `postgres://<username>:<password>@<host>:<port>/<database>?<parameters>` | [Docs](https://www.cockroachlabs.com/docs/v24.1/connection-parameters#connect-using-a-url) |
| MariaDB | `mariadb://[<user>[:<password>]@]<host>[:<port>]/[<db>[?<opt1>=<value1>[&<optx>=<valuex>]]]` | [Docs](https://github.com/mariadb-corporation/mariadb-connector-nodejs/blob/master/documentation/connection-options.md) |
| Microsoft SQL | `Server=[:serverName],[:port];Database=[:database];User Id=[user];Password=[:password];Encrypt=[true/false]` | [Docs](https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/connection-string-syntax) |
| MongoDB | `mongodb+srv://<username>:<password>@<host>/?retryWrites=true&w=majority` | [Docs](https://www.mongodb.com/docs/manual/reference/connection-string/) |
| MySQL | `mysql://[:username]:[:password]@[:host]:[:port]/[:database]` | [Docs](https://dev.mysql.com/doc/refman/8.4/en/connecting-using-uri-or-key-value-pairs.html) |
| PostgreSQL | `postgres://[:user]:[:password]@[:host]:[:port]/[:database]` | [Docs](https://github.com/brianc/node-postgres/tree/master/packages/pg-connection-string) |
| Redis | `redis://[:password@]host[:port][/db-number]` | [Docs](https://github.com/redis/node-redis/blob/master/docs/client-configuration.md) |

## Networking

For Prod AI to connect to your database, your Prod AI data plane needs network access:

* **Dedicated Cloud:** Allowlist your dedicated data plane's static egress IP addresses (provided by your Prod AI team) in your database firewall or security group. Private networking for Dedicated Cloud is coming soon.
* **Managed BYOC:** Data planes run directly inside your AWS account and connect to private databases over your VPC network without exposing them to the public internet.

### IP allowlist

See [Configure IP allowlist for databases](https://docs.prod.ai/integrations/auth/guides/configure-ip-allowlist-for-databases.md) for step-by-step instructions on adding your data plane's egress IP addresses in AWS and GCP.

## Network settings

### SSL configuration

Prod AI supports encrypted database connections using SSL/TLS for [supported integrations](#support-by-integration).

#### Configuring SSL

![SSL Certificate Authentication Form](https://mintcdn.com/prod-ai/PgFRt41j3RlUW19_/images/integrations/authentication/ssl_certificates.png?fit=max\&auto=format\&n=PgFRt41j3RlUW19_\&q=85\&s=c980fe437f16f2d9298cf22edf0a2b89)

1. On the integration configuration form for your database, select **Enable SSL**
2. Optionally, select **Use a self-signed SSL certificate** and provide:
   * **Server CA**: Database server's Certificate Authority (CA) certificate
   * **Client key**: Client's private key
   * **Client cert**: Client's public key certificate

### SSH configuration

When a database sits on a private subnet and cannot be accessed directly, you can connect through an SSH bastion host using SSH tunneling.

#### SSH authentication methods

Prod AI supports the following SSH authentication methods:

* Username/password
* Private key authentication
* Public key authentication (RSA or Ed25519)

#### Configuring SSH tunnels

SSH tunneling can be configured using the integration configuration form for [supported integrations](#support-by-integration).

1. Configure your SSH server to allow connections from your [Prod AI data plane's IP addresses](https://docs.prod.ai/deployment/security/overview.md#ip-addresses)
2. On the integration configuration form for your database, select **Use SSH Tunnel**
3. Select an **Authentication method**
4. Specify the shared configuration values:
   * **Bastion host**: The hostname or IP address of the SSH server
   * **Bastion port**: The port number used for the SSH connection
   * **Bastion username**: The username required for SSH authentication
5. Complete the fields for the selected **Authentication method**:

   > [tab] Password
   >
   > Enter the following configuration values:
   >
   > * **Password**: The SSH account password for the **Bastion user**

   > [tab] Private key
   >
   > Enter the following configuration values:
   >
   > * **Public key**: The public key of your SSH server's public/private key pair
   > * **Private key**: The private key of your SSH server's public/private key pair

   > [tab] Public key (RSA or Ed25519)
   >
   > Copy the Prod AI-provided **Public key** to your SSH server's `~/.ssh/authorized_keys` file

### Support by integration

The following network settings are supported by each database integration:

| Integration | SSL | SSL Certificate | SSH Tunneling |
| - | - | - | - |
| [Amazon Redshift](https://docs.prod.ai/integrations/integrations-library/aws-redshift) | ✓ | ✗ | ✗ |
| [CockroachDB](https://docs.prod.ai/integrations/integrations-library/cockroachdb) | ✓ | ✓ | ✗ |
| [MariaDB](https://docs.prod.ai/integrations/integrations-library/mariadb) | ✓ | ✓ | ✗ |
| [Microsoft SQL Server](https://docs.prod.ai/integrations/integrations-library/mssql) | ✓ | ✗ | ✗ |
| [MongoDB](https://docs.prod.ai/integrations/integrations-library/mongodb) | ✓ | ✓ | ✗ |
| [MySQL](https://docs.prod.ai/integrations/integrations-library/mysql) | ✓ | ✓ | ✓ |
| [Postgres](https://docs.prod.ai/integrations/integrations-library/postgres) | ✓ | ✓ | ✓ |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.