# Enterprise Database

Relyance provides direct connectivity to your enterprise databases. This streamlined approach simplifies database access for scanning schemas and data inspection.

This integration connects directly with major databases like Microsoft SQL Server, MySQL/MariaDB, PostgreSQL, and Oracle. It scans schemas, analyzes metadata, and samples data to identify Personally Identifiable Information (PII).

In order to integrate your Enterprise Database with Relyance AI you will need your database connection settings.

It is recommended to create a Relyance service account in your database with the appropriate access privileges.

### Finding your connection settings:

**MS SQL**

- **Endpoint**: The server url where MS SQL is installed (do not include the protocol such as 'http', e.g. `remotedb.example.com` ).
- **Port**: 1433 (default) for MS SQL, but double-check if unsure.
- **Database Name**: The specific database within the system.
- **Database Username**: A valid SQL Server login with access privileges (the user should at least have **db_datareader** access to read the database contents).
- **Database Password**: The password associated with the chosen username.
- **Engine Type**: Use ' *sqlserver* '

**MySQL/MariaDB**

- **Endpoint**: The hostname or IP address of the computer where MySQL is installed (do not include the protocol such as 'http', e.g. `remotedb.example.com` ).
- **Port**: 3306 (default) for MySQL, but double-check if unsure.
- **Database Name**: The specific database within the system.
- **Database Username**: A valid MySQL user with access privileges.
- **Database Password**: The password associated with the chosen username.
- **Engine Type**: Use '*mysql*'

**Postgres**

- **Endpoint**: The hostname or IP address of the computer where PostgreSQL is installed (do not include the protocol such as 'http', e.g. `remotedb.example.com` ).
- **Port**: 5432 (default) for PostgreSQL, but double-check if unsure.
- **Database Name**: The specific database within the system.
- **Database Username**: A valid PostgreSQL user with access privileges.
- **Database Password**: The password associated with the chosen username.
- **Engine Type**: Use '*postgres*'

**Oracle**

- **Endpoint:** The hostname or IP address of the computer where Oracle is installed (do not include the protocol such as 'http', e.g. `remotedb.example.com` ).
- **Port:** 1521 (default) for Oracle, but double-check if unsure.
- **Database Name:** The database System Identifier (SID) you want to connect to.
- **Database Username:** A valid Oracle user with access privileges, including the schema name if applicable. (e. g., username@schema_name)
- **Database Password:** The password associated with the chosen username.
- **Engine Type:** Use '*oracle*'

For securing the Database connections, add the Relyance NAT IP or CIDR from the article

Relyance AI IP Addresses for Allow Lists to your allow list. This restricts access only to authorized connections from that specific IP addresses, minimizing security risks.

#### In the Relyance AI application:

1. Login to your Relyance account.
2. Navigate to the **Settings** Menu in the bottom left-hand side.
3. Select **Integrations**.
4. Find the **Enterprise Database** integration card and click it to open its connections.
5. Under **Authentication Method**, choose **Generic DB Connect**.
7. Paste the **Connection settings** into their respective fields.

![EnterpriseDatabase-1.png](https://assets.relyanceuat.xyz/images/docs/27391533284365/27392234935693.png)

 Select the **Enable Data Inspection** checkbox if you wish Relyance also to inspect the data.

Note: The **Min Likelihood** sets the analysis sensitivity of the data inspection. Lower likelihoods (unlikely) provide more coverage but may generate false positives, while higher sensitivity (very likely) provides more accuracy but may have less coverage.
8. Click **Authenticate**.
9. At this point, you should see the following result on the integrations page:

![EnterpriseDatabase-2.png](https://assets.relyanceuat.xyz/images/docs/27391533284365/27392224053773.png)

10. Congratulations, you are now connected to your **Enterprise Database**.

<!-- failure-modes:begin (generated from the integration catalog; do not hand-edit) -->

## If the connection reports Connected but returns nothing

These are the ways this integration comes back empty without reporting an error. Generated from the integration catalog, so it tracks what the connection actually asks for.

1. **A credential rotated at the vendor is not picked up here.** **Password** is stored when you save the connection, so regenerating the value at the vendor breaks the next scan until it is re-pasted here. Recording the expiry on the connection means Relyance warns you before it lapses.
2. **Check the address fields before suspecting the credentials.** **Endpoint** identifies which tenant, region or host to talk to. A wrong value there fails authentication and looks exactly like a bad secret.

<!-- failure-modes:end -->

<!-- terraform-examples:begin (generated from the integration catalog; do not hand-edit) -->

## Manage this integration with Terraform

Connections for this integration can be managed as code with the [Relyance Terraform provider](https://registry.terraform.io/providers/Relyance/relyance/latest). Non-secret fields go in `auth.params`; secret fields go in `auth.secrets_wo`, which is write-only — never stored in Terraform state. Rotate secrets by bumping `auth.secrets_wo_version`.

```hcl
resource "relyance_integration_connection" "relyance_rdbms" {
  vendor = "relyance_rdbms"
  name   = "<your connection name>"

  auth = {
    method = "username-password"
    params = {
      endpoint = "<endpoint>"
      port = "<port>"
      database = "<database>"
      username = "<username>"
      engine = "<engine>"
      data_storage_location = "us"
    }
    # Secret fields are write-only: sent to Relyance, never stored in state.
    secrets_wo = {
      password = var.relyance_rdbms_password
    }
    secrets_wo_version = 1
  }

  scans = { "data-inspection" = { enabled = true } }
}
```

<!-- terraform-examples:end -->
