Linking MySQL as a source
Let AI connect your sources for you
Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog.

Contents
The MySQL connector can link your database tables to PostHog.
To link MySQL:
- Go to the Data pipeline page and the sources tab in PostHog
- Click New source and select MySQL
- Enter your database connection details:
- Host: The hostname or IP your database server like
db.example.comor123.132.1.100. - Port: The port your database server is listening to. The default is
3306. - Database: The name of the database you want like
analytics_db. - User: The username with the necessary permissions to access the database.
- Password: The password for the user.
- Schema: The schema for your database where your tables are located. The default is
public. - Use SSL: Whether to use SSL for the connection. Default is enabled.
- Host: The hostname or IP your database server like
- If you need to connect through an SSH tunnel, enable and configure it (optional):
- Tunnel host: The hostname of your SSH server.
- Tunnel port: The port your SSH server is listening on.
- Authentication type:
- For password authentication, enter your SSH username and password.
- For key-based authentication, enter your SSH username, private key, and optional passphrase.
- Click Next
The data warehouse then starts syncing your MySQL data. You can see details and progress in the sources tab.
Configuration
| Option | Description |
|---|---|
HostType: text Required: True | Must be reachable from the public internet. Add PostHog's egress IP addresses to your firewall allowlist (see the docs above) and use a public host. |
PortType: number Required: True | |
DatabaseType: text Required: True | |
UserType: text Required: True | |
PasswordType: password Required: True | |
SchemaType: text Required: False | |
Use SSL?Type: select Required: True | |
Verify the server certificate?Type: select Required: True | Check that your database's TLS certificate comes from a trusted authority. A self-signed certificate or a private authority does not pass, so leave this off if you use one. Through an SSH tunnel we check the certificate chain but not the hostname, because the tunnel presents your database on a local address. |
Use SSH tunnel?Type: ssh-tunnel Required: False |
Selecting columns
By default, PostHog syncs all columns from each table. To sync only specific columns:
- During source setup, click Columns next to any table in the table picker.
- Uncheck columns you don't want to sync.
- Primary key columns and the incremental sync field (if configured) are always synced and cannot be disabled.
You can also change column selection after setup:
- Go to the sources tab and click your MySQL source.
- Click Configure next to any schema.
- Under Columns, select which columns to sync.
When you add columns to a schema using incremental or append sync, PostHog prompts you to choose:
- Sync forward only - New columns are populated only for future data. Existing rows show
NULLfor the new columns. - Full resync - Triggers a complete resync to backfill the new columns for all rows.
Numeric or decimal columns with values exceeding a precision of 76 or scale of 32 cannot be synced. If your sync fails with this error, you have three options:
- Constrain the column with a lower precision/scale
- Cast it to text in a view
- Round the values at the source
Inbound IP addresses
We use a set of IP addresses to access your instance. To ensure this connector works, add these IPs to your inbound security rules:
| US | EU |
|---|---|
| 44.205.89.55 | 3.75.65.221 |
| 52.4.194.122 | 18.197.246.42 |
| 44.208.188.173 | 3.120.223.253 |