Connectors → MySQL

About MySQL

MySQL is one of the most popular open-source relational database management systems. MySQL has a proven track record of performance, reliability, and ease-of-use. A relational database organizes data into tables. These tables contain data types that can have relations. These relationships help structure the data. Programmers use SQL to create, extract, modify, and control access to data in a relational database.

MySQL Connector

Incorta loads data from a MySQL database using the MySQL connector. The MySQL Connector uses the 5.1.48 MySQL driver.

The MySQL connector supports the following Incorta specific functionality:

Feature Supported
Incremental Load
Encryption at Ingest
Performance Optimization
Webhook Callbacks
Load Filter
Note

The MySQL Connector supports two types of incremental load, including support for using a numeric column. To learn more see Types of Incremental Load

Steps to connect MySQL and Incorta

To connect MySQL and Incorta, here are the high level steps, tools, and procedures:

Create an external data source

Here are the steps to create a external data source with the MySQL connector:

  • Sign in to the Incorta Direct Data Platform.
  • In the Navigation bar, select Data.
  • In the Action bar, select + NewAdd Data Source.
  • In the Choose a Data Source dialog, in Database, select MySQL.
  • In the New Data Source dialog, specify the applicable connector properties.
  • To test, select Test Connection.
  • Select Ok to save your changes.

MySQL connector properties

Here are the properties for the MySQL connector:

Property Control Description
Data Source Name text box Enter the name of the data source
Username text box Enter the database username
Password text box Enter the database password
Connection Pool text box Enter the connection pool. The default is 30.
Connection String text box Enter the connection string for the MySQL JDBC driver. The format is: jdbc:mysql://<HOST>:<PORT>/<DATABASE_NAME>
The default JDBC port for a MySQL Database is: 3306. Verify port numbers with your datasource configurations.

| | Connection Properties | text box | Customized string input of key/value pair properties. See below for details on connection properties. |

Connection Properties

The connection properties allow for customized connection to your MySQL database. The properties are accepted in a key=value format. The type of connector properties can range from username and password to SSL settings. The 5.1.48 MySQL driver determines the available connection properties. For a list of connection properties available with Incorta and a MySQL database refer to Configuration Properties for Connector.

Create a schema with the Schema Wizard

Here are the steps to create an MySQL schema with the Schema Wizard:

  • Sign in to the Incorta Direct Data Platform.
  • In the Navigation bar, select Schema.
  • In the Action bar, select + New → Schema Wizard.
  • In (1) Choose a Source, specify the following:

    • For Enter a name, enter the schema name.
    • For Select a Datasource, select the MySQL external data source.
    • Optionally create a description.
  • In the Schema Wizard footer, select Next.
  • In (2) Manage Tables, in the Data Panel, first select the name of the Data Source, and then check the Select All checkbox.
  • In the Schema Wizard footer, select Next.
  • In (3) Finalize, in the Schema Wizard footer, select Create Schema.

Create a schema with the Schema Designer

Here are the steps to create an MySQL schema using the Schema Designer:

  • Sign in to the Incorta Direct Data Platform.
  • In the Navigation bar, select Schema.
  • In the Action bar, select + New → Create Schema.
  • In Name, specify the schema name, and select Save.
  • In Start adding tables to your schema, select SQL Database.
  • In the Data Source dialog, specify the MySQL table data source properties.
  • Select Add.
  • In the Table Editor, in the Table Summary section, enter the table name.
  • To save your changes, select Done in the Action bar.

MySQL table data source properties

For a schema table in Incorta, you can define the following MySQL specific data source properties as follows:

Property Control Description
Type drop down list Default is SQL Database
Data Source drop down list Select the MySQL external data source
Incremental toggle Enable the incremental load configuration for the schema table. See Types of Incremental Load.
Incremental Extract Using drop down list Select between Last Successful Extract Time and Maximum Value of a Column. See Types of Incremental Load. (Visible when Incremental is enabled)
Incremental Column drop down list Select the column to be used in a Maximum Value of a Column. Loader will track and use the greatest value, most recent timestamp, for each load operation. (Visible when Maximum Value of a Column is selected)
Query text box Enter the SQL query to retrieve data from the MySQL database
Update Query text box Define the SQL update query to use during an incremental load. (Visible when Incremental is enabled)
Incremental Field Type drop down list Select what the format of the incremental field type is: Timestamp, Unix Epoch (seconds), or Unix Epoch (milliseconds). (Visible when Incremental is enabled)
Fetch Size text box Used for performance improvement, fetch size defines the number of records that will be retrieved from the database in each batch until all records are retrieved. The default is 5000.
Chunking Method drop down list Default is No Chunking. Chunking methods allow for parallel extraction of large tables.
Enable Spark Based Extraction toggle Enable the configuration of a Spark job to parallelize the data ingest.
Max Number of Parallel Queries text box In a Spark job, specify the maximum number of parallel queries. (Visible when Spark based extraction is enabled)
Column to Parallelize Queries on drop down list Select the numerical column in the source table that Spark will parallelize the extraction queries from. (Visible when Spark based extraction is enabled)
Memory Per Extractor text box In a Spark job, allocate the amount of memory per extractor. Units are in gigabytes. (Visible when Spark based extraction is enabled)
Callback toggle Turn this option on to enable the Callback URL field
Callback URL text box This property appears when the Callback toggle is turned on. Specify the URL. (Visible when callback is enabled)


View the schema diagram with the Schema Diagram Viewer

Here are the steps to view the schema diagram using the Schema Diagram Viewer:

  • Sign in to the Incorta Direct Data Platform.
  • In the Navigation bar, select Schema.
  • In the list of schemas, select the MySQL schema.
  • In the Schema Designer, in the Action bar, select Diagram.

Load the schema

Here are the steps to perform a Full Load of the MySQL schema using the Schema Designer:

  • Sign in to the Incorta Direct Data Platform.
  • In the Navigation bar, select Schema.
  • In the list of schemas, select the MySQL schema.
  • In the Schema Designer, in the Action bar, select Load → Load Now → Full.
  • To review the load status, in Last Load Status, select the date.

Explore the schema

With the full load of the MySQL schema complete, you can use the Analyzer to explore the schema, create your first insight, and save the insight to a new dashboard.

To open the Analyzer from the schema, follow these steps:

  • In the Navigation bar, select Schema.
  • In the Schema Manager, in the List view, select the MySQL schema.
  • In the Schema Designer, in the Action bar, select Explore Data.

Additional Considerations

Types of Incremental Load

You can enable Incremental Load for a MySQL table data source. There are two types of incremental extracts:

Last Successful Extract Time

Fetch updates since the last time the tables were loaded. Determined by the difference between the current time and the database timestamp.

Maximum Value of a Column

The column-based strategy depends on an extra column called “Incremental Column” in each table. The MySQL connector supports both timestamp and numeric columns. A timestamp column is of the type date or timestamp. A numeric column is of the type int or long.

Note

Changing the incremental load strategy requires a full load to ensure data integrity.

Incremental Load Example

In this example, the invoices table must contain a column of the type Date or Timestamp in order to load the table incrementally with a last successful extract time strategy. In this case, the name of the date column is ModifiedDate and the format of the column is Timestamp.

Here are the data source property values for this example:

  • Incremental is enabled
  • Query contains SELECT * FROM `invoices`
  • Update Query contains SELECT * FROM `invoices` WHERE `ModifiedDate` > ?
Note

? is a variable in the update query that contains the last schema refresh date.

  • Incremental Field Type = Timestamp
Note

Incorta replaces the ? reference character with a value.

Valid Query Types

When creating a query for your MySQL Connector, please note that only SELECT statements are valid.


© Incorta, Inc. All Rights Reserved.