How-To Guides
Integration Guides

MySQL Integration Guide

11min

Review the following guide for setting up an integration between Manufacturing Connect Edge and a MySQL database.

User Scenario

In this guide you will deploy a MySQL database container from Manufacturing Connect Edge and then integrate with the database using the DB-MySQL connector. For your specific scenario you may use an external MySQL database to set up the integration.

If using a database not deployed through Manufacturing Connect Edge, you can use the following supported versions:

  • MySQL (4.1+)
  • MariaDB
  • Percona Server
  • Google CloudSQL
  • Sphinx (2.2.3+)

For external MySQL databases, refer to the following to learn more:

Step 1: Add Device



Step 2: Add Tags



Step 3: Add MySQL Marketplace Application

Note: The version used in this use case for MySQL version is 8.0. See the MySQL 8.0 Reference Manual for more information.

To add the MySQL Marketplace Application:

  1. In Manufacturing Connect Edge, navigate to Applications > Marketplace.
  2. Click Marketplace List and select Default Marketplace Catalog.
  3. Click the MySQL application tile.
  4. From the Installation script version drop-down list, select latest.
  5. Configure the following parameters.
    • Name: Enter MySQL.
    • Database: Enter sample.
    • User: Enter user.
    • Password: Enter the user password.
    • MySQL password: Enter the same value as the Password parameter.
  6. Click Launch.
  7. Navigate to Applications > Catalog Apps. The MySQL application appears, pulls the image, and then starts the application. The MySQL application shows as running.
  8. Navigate to Applications > Containers. The MySQL application Container is running.
  9. Copy the IP address for the MySQL application.

Step 4: Add the DB - MySQL Connector

Follow the steps to Add a Connector and select the DB - MySQL provider.

Configure the following parameters.

  • Name: Enter a name for the connector.
  • Hostname: Paste the IP address you copied in Step 3.
  • Port: The MySQL Server port. The default value is 3306.
  • Username: Enter user.
  • Password (Optional): Enter the user password.
  • Database: Enter sample.
  • Table: Enter test_table.
  • Show Mapping: Select the check box to display mappings. See Work with Tables in SQL Connectors (Create Table and Show Mapping) to learn more. Too add key/value pairs for the custom table, see Configure Key/Value Pairs.
  • Create table: If you want to send data to an existing table in the default format, or you want to create a new table in the default format, select this checkbox and unselect Show Mapping. See Work with Tables in SQL Connectors (Create Table and Show Mapping) to learn more.
  • Commit timeout: Enter the transaction commit timeout in (ms).
  • Max transaction size: Enter the maximum number of messages before a transaction is committed, regardless of timeout parameter.
  • Throttling limit: The maximum number of messages per second to be processed. The default value is zero, which means that there is no limit.
  • Persistent storage: When enabled, this will cause messages to undergo a store-and-forward procedure. Messages will be stored within Manufacturing Connect Edge when cloud providers are online.
  • Queue Mode: Select the queue mode as lifo (last in first out) or fifo (first in first out). Selecting lifo means that the last data entry is processed first, and selecting fifo means the first data entry is processed first.

Step 5: Enable the Connector

After adding the connector, click the toggle in the connector tile to enable it.

Document image


If you see a Failed status, you can review the Connector Logs and relevant error messages.

Step 6: Create Topics for Connector

You will now need to import the tags created in Step 2 as topics for the MySQL connector. The topics will be created as outbound topics.



After adding all required topics, navigate to the Integration overview page and ensure the connector is not disabled and still shows a CONNECTED status.

Step 7: Enable Topics

To enable the topics, return to the Topics tab and click the Enable all topics icon.

Enable all topics icon
Enable all topics icon


Step 8: Make MySQL Queries

You can now verify that you can view data through the terminal command window.

Update the credentials, database name, and table name to your own specific configurations.

To make queries in the container terminal:

  1. In Manufacturing Connect Edge, navigate to Applications > Containers.
  2. Click the Terminal icon next to the MySQL container. The MySQL shell opens.
  3. From the MySQL container terminal, enter mysql -u user -p and press ENTER. Enter password: appears.
  4. Enter your user password, and then press ENTER. Welcome to the MySQL monitor appears.
  5. Enter show databases; and press ENTER. The database name appears.
  6. Enter use sample; and press ENTER. Reading table information for completion of table and column names appears in the console.
  7. Enter show tables; and press ENTER. The table names for sample appear.
  8. Enter select * from test_table; and press ENTER. Data appears from the imported tags for the connector.

    MySQL connection messages
    MySQL connection messages