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

# MySQL

> MySQL is an open source relational database management system (RDBMS) with a client-server model.

## Overview

Hightouch lets you pull data stored in MySQL and push it to downstream destinations. Most of the setup occurs in the Hightouch UI, but you need access to MySQL for information like your hostname, port, and credentials.

Hightouch unofficially supports backwards compatible MySQL forks such as [TiDB by Pingcap](https://en.pingcap.com/).

> [!NOTE]
>
> You may need to allowlist Hightouch's IP addresses to let our systems connect to your MySQL instance. Reference our [networking docs](https://docs.hightouch.com/security/networking#ip-addresses) to determine which IP addresses you need to allowlist.
>
> You can also securely connect to your MySQL instance using [AWS PrivateLink](https://docs.hightouch.com/security/aws/privatelink.md) or [GCP Private Service Connect](https://docs.hightouch.com/security/gcp/private-service-connect.md). AWS PrivateLink and GCP Private Service Connect are [Business Tier](https://hightouch.com/pricing) features.

### MariaDB support

Hightouch supports using MariaDB as a source via the MySQL source. Follow the instructions below, substituting MySQL information and credentials with your MariaDB ones.

## Connection configuration

To get started, go to the [**Sources** overview page](https://app.hightouch.com/sources?from=docs) and click the **Add source** button. Select **MySQL** and follow the steps below.

### Choose connection type

Hightouch can connect directly to true over the public internet or via an SSH tunnel. Since data is encrypted in transit via TLS, a direct connection is suitable for most use cases. You may need to set up a tunnel if your true instance is on a private network or virtual private cloud (VPC).

![Direct connection vs. SSH tunnel](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/get-started/connection-types-comparison.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=2300535707894b1f08608939cac812b2)

Hightouch supports both standard and reverse SSH tunnels. To learn more about SSH tunneling, refer to Hightouch's [tunneling documentation](https://docs.hightouch.com/security/ssh-tunneling.md).

### Configure your source

Enter the following required fields into Hightouch:

* **Host**: The hostname or IP address of your MySQL.
* **Port**: The port number of your MySQL. The default is 3306, but yours may be different.
* **Database**: The name of the database in your MySQL.

### Provide your credentials

Enter the following fields into Hightouch:

* **User**: This can be your personal MySQL login or a dedicated user for Hightouch.
* (Optional) **Password**: The password for the user specified above.

## Test your connection

When setting up MySQL as a source for the first time, Hightouch validates your credentials and access to your database. Once the test passes, click **Continue** to finish setup.

## Create models

Once your source configuration has passed the necessary validation, you've completed setting up MySQL as a source. Next, you can set up [models](https://docs.hightouch.com/getting-started/concepts.md#models) to define which data you want to pull from MySQL.

The MySQL source supports these modeling methods:

* writing a query in [the SQL editor](https://docs.hightouch.com/models/sql-editor.md)
* using the visual [table selector](https://docs.hightouch.com/models/table-selector.md)
* leveraging existing [dbt models](https://docs.hightouch.com/extensions/dbt-models.md)

## Tips and troubleshooting

If you run into an issue this page doesn't cover, [contact support](#pylon-chat).

### Server does not support secure connection

The [connection test](#test-your-connection) returns this error message if you don't enable SSL connections in your MySQL server configuration.
To solve this, make sure to configure MySQL to [use encrypted connections](https://dev.mysql.com/doc/refman/8.0/en/using-encrypted-connections.html).
