MySQL connector
Ori Sagi avatar
Written by Ori Sagi
Updated over a week ago

Pecan uses an industry-standard MySQL JDBC Driver to connect to your MySQL database so you can import data from it, and optionally, send predictions back to it. These processes happen automatically and only require Pecan to have access to your database.

The relevant steps are described below. If you need help with them, be sure to consult with your internal IT or DevOps team.

Prerequisite steps

  1. First, make sure you whitelist these Pecan IP addresses:

    54.246.108.184
    34.254.11.37
    54.216.8.168
    54.217.189.54
    54.73.234.235
    54.170.135.39
    79.125.57.39

2. Next, create a user for Pecan on your MySQL server by using the CREATE USER SQL command. This will provide Pecan with read access to the tables that will be used to build your model(s).

If you’re not sure which tables will be needed, you can simply provide read access to all tables. You’ll be able to decide which tables to import later when you import your data to Pecan.

How to configure a MySQL connection in Pecan

  1. Log in to Pecan, select the “Connections” tab, and click Add connection.

  2. Select “MySQL” and complete the following fields:

    • Connection name – This is how you’ll identify the connection when creating and working with models on the platform.

      • Names should be unique, reflecting the data source and what’s stored in it.

      • Valid characters include letters, numbers, and underscores (e.g. “paid_downloads_fall_2021”).

      • Note that connection names can’t be changed once created.

    • Connection type – Select "Read" if the connection will be used to import data into Pecan. Select "Write" if it will be used to export predictions from Pecan to MySQL.

    • Hostname – This is the address of your database (e.g. my_db.eu-west-1.mysql.amazonaws.com, 96.127.44.11).

    • Port – This is the IP address of your server and connection port. The default port for MySQL instances is 3306.

    • Database – This is the name of the database Pecan should use.

      • Servers can hold many databases. If you want to access data from multiple databases that sit on the same server, you’ll need to create a new Pecan connection for each database.

    • Username and Password – You will have created these on your MySQL server during Step 2 of the prerequisite steps (above).

  3. Now, click Test connection to make sure everything is working correctly. Then click Create connection to complete the setup. (For more information, see Testing and creating a data connection.)

Did this answer your question?