# Database connections

Orbit Connect supports several database providers, enabling you to specify and securely store database credentials and connect your database.

Supported database providers:

- **PostgreSQL**
- **Amazon Redshift**
- **MySQL**
- **Snowflake**
- **Microsoft SQL Server**, including **Azure SQL**

You can import a table or view directly, or write a [custom query](<https://help.apteco.com/en/orbit/connect/data-sources/custom-queries/index.md>) to choose, filter, and join your data before you import it.

## Import your data

To import your data using Orbit Connect:

1. Select the **Orbit Connect** icon.

   [![The Orbit Connect icon](<https://help.apteco.com/assets/images/orbit/connect/data-sources/database-connections/Orbit_connect.jpg>)](<https://help.apteco.com/assets/images/orbit/connect/data-sources/database-connections/Orbit_connect.jpg>)
2. In **Data Sources**, select **\+ New Data Source**.
3. Next to your database type, such as SQL Server, select **Connect**.
4. Provide a descriptive name for your data source, then select **Create**.
5. From the **Credential** list, select **\+ New Credential**.

   If you've already added a credential for this database, choose it instead and go to step 8.
6. Fill in the following:

   - **Credential Name**
   - **Connection String**: see [Example database connection strings](<#example-database-connection-strings>) for the format

   When you move out of the **Connection String** box, Orbit Connect tests it and shows **Connection String is valid** if it works.

   [![The Create DB Connection Credential dialog, confirming the connection string is valid](<https://help.apteco.com/assets/images/orbit/connect/data-sources/database-connections/Database_credentials.png>)](<https://help.apteco.com/assets/images/orbit/connect/data-sources/database-connections/Database_credentials.png>)
7. Select **Add**.
8. From the **Tables & Views** list, select the table or view to import.

   A data preview appears.

   To import the results of your own SQL query instead, select **Custom SQL**. Use a read-only credential for custom queries. For more information, see [Custom queries](<https://help.apteco.com/en/orbit/connect/data-sources/custom-queries/index.md>).
9. Select **Import**.

You've completed your data import. You can now [map your data](<https://help.apteco.com/en/orbit/connect/data-mappings/index.md>) to a User Defined Table or, if you use the Apteco CDP, to a Customer Data Table.

## Example database connection strings

Use these formats for the **Connection String** when you add a credential. Replace each placeholder in angle brackets with your own details.

### PostgreSQL

```text
Server=<server>;Port=5432;Database=<database>;Uid=<username>;Pwd=<password>;
```

### Amazon Redshift

```text
User ID=<username>;Password=<password>;Host=<workgroup>.<account_number>.<region>.redshift-serverless.amazonaws.com;Port=<port>;Database=<database>;
```

### MySQL

```text
server=<server>;database=<database>;user=<username>;password=<password>
```

For `<server>`, use the server name or IP address of your MySQL server. For supported MySQL versions, see [mysqlconnector.net](<https://mysqlconnector.net/>).

### Snowflake

```text
scheme=https;ACCOUNT=<account>;HOST=<account_identifier>.snowflakecomputing.com;port=443;USER=<username>;PASSWORD=<password>;DB=<database>;
```

> [!NOTE]
>
> You can find your **Account Identifier** in Snowflake under **Account Details**.

### SQL Server

```text
Server=<server>;Initial Catalog=<database>;User ID=<username>;Password=<password>
```

### Azure SQL

```text
Server=tcp:<myserver>.database.windows.net,1433;Database=<database>;User ID=<username>;Password=<password>;Trusted_Connection=False;Encrypt=True;
```
