Skip to content

Connect DigitalOcean MySQL to Infograph

What it brings in: Every table and view the user can read.

What you need

  • A DigitalOcean Managed MySQL cluster.
  • Its doadmin password, or a user you created for Infograph.
  • Infograph's sync servers connect from 51.222.152.247.

Your connection string

Each part is one thing you fill in, and each can fail on its own.

DigitalOcean MySQL· Connection string
mysql://:@[cluster]-do-user-[n]-0.[x].db.ondigitalocean.comhost: fix for "We couldn't find that host. Check the host name, then try again.":25060port: fix for "The host refused the connection. Check the port, and that your database accepts connections from Infograph's address."/defaultdbdatabase: fix for "That database does not exist on this server."?ssl-mode=REQUIRED
AddressSign inDatabaseSelect a label for its fix

Steps

  1. Allow Infograph's sync servers

    If your cluster uses trusted sources, open its Network Access tab, choose Add Trusted Sources and add the addresses below.

    51.222.152.247
  2. Create a read-only user (optional)

    Add a user named infograph under Users & Databases, then connect as doadmin and give it read access only.

    GRANT SELECT, SHOW VIEW ON [database].* TO 'infograph'@'%';
  3. Copy the connection string

    On the cluster's Overview, under Connection Details, choose Public network and Connection string, then copy it. The port is 25060.

    mysql://doadmin:[password]@[cluster]-do-user-[n]-0.[x].db.ondigitalocean.com:25060/defaultdb?ssl-mode=REQUIRED
  4. Paste it in Infograph and choose your tables

    Open DigitalOcean MySQL in Infograph, paste the string and press Connect. Pick the tables you want and Infograph starts loading them.

    Allow 51.222.152.247 through your firewall so Infograph can connect.

    Connect

Troubleshooting

Each entry is the message Infograph shows when a connection fails. Open it for the fix.

This host is not reachable from Infograph. Use your database's public address.

This is a private address. Choose Public network in Connection Details and copy the string again.

We couldn't find that host. Check the host name, then try again.

Copy the string again from Connection Details with Public network chosen. A host starting with private- is the VPC host, which only your DigitalOcean network can reach.

The host refused the connection. Check the port, and that your database accepts connections from Infograph's address.

DigitalOcean MySQL listens on port 25060, not 3306. Copy the string again from Connection Details.

The server closed the connection. Check that it allows Infograph's address, and whether it requires an encrypted connection.

The server answered, then hung up before Infograph could sign in. Check it allows 51.222.152.247: some hosts close the connection rather than refuse it. If the server accepts only encrypted connections, set SSL Mode to Required under Advanced.

The host did not answer in time. Check the host and port, and that your firewall allows Infograph's address.

If the cluster uses trusted sources, add 51.222.152.247 on its Network Access tab.

The username or password was not accepted.

Check the user and password. You can reset a user's password under Users & Databases. Characters such as @, # or / must be percent-encoded in a string, so @ becomes %40.

Those credentials were not accepted.

Check the user and password, or copy the string again from Connection Details, which includes the doadmin password.

That database does not exist on this server.

The database name is the part after the last / in the string. A new cluster's database is defaultdb; Users & Databases lists the others.

This server does not offer an encrypted connection. Turn on TLS on the server, or set SSL Mode to Preferred.

SSL Mode is set to Required, but the server would not encrypt the connection. Turn on TLS on the server, and check the host is the database's own address rather than a proxy in front of it. Or set SSL Mode to Preferred under Advanced.