Skip to main content

Connecting to Postgres or MySQL

Updated over 2 weeks ago

SyncWith has built in Google Sheets integrations for Postgres or MySQL databases. You can run arbitrary SQL and have it import directly into your Google Sheet.

Configuration

To connect to your database, configure your report with either Connection parameters or a Connection string. We recommend using Connection string.

Connection Parameters

To connect to your database with connection parameters, you'll enter each aspect of your login details in its own field: host, username, password, database name, port number.

This mode has an easy-to-use UI, but offers less flexibility for specifying database-specific settings like SSL options. To specify those settings, use connection strings.

Connection Strings

The most flexible way to connect to your database is with a connection string. If you use a hosted database, it is also the most easiest: most web hosting companies will provide you with a connection string in the admin UI.

It will look something like postgres://YourUserName:YourPassword@YourHostname:5432/YourDatabaseName

Static IP Addresses

If your database is protected by network security, you can whitelist SyncWith’s static IP addresses to enable SyncWith to access your database securely:

  • 3.227.95.35

  • 34.199.138.158

Common Errors

You may need to adjust settings on your database server to permit SyncWith to communicate with it.

ENOTFOUND

ENOTFOUND often means that you are using an internal hostname. SyncWith needs an external hostname.

Internal hostnames often look like:

- 192.168.x.x

- 172.30.x.x

- justahost (an external hostname include a domain, for example: ahost.domain.com)

You may need to ask your hosting provider for assistance.

ETIMEDOUT

ETIMEDOUT often means that your database is blocking us at the network level via firewall rules. You will need to permit access to SyncWith’s static IP addresses (see above).

ECONNREFUSED

ECONNREFUSED means the connection was refused, this could be because the host is incorrect, or the port is incorrect, or it could also be because the host is blocking us at the network level. Please check your host and port, if they are correct then you might need to permit access to SyncWith’s static IP addresses (see above).

EAI_AGAIN

EAI_AGAIN is typically a DNS configuration issue, sometimes its temporary, please consider using a tool like https://intodns.com/ to check your DNS configuration.

Did this answer your question?