---
title: MySQL SSL Integration Guide
slug: manufacturing-connect-edge/mysql-ssl-integration-guide
docTags: 
createdAt: 2024-01-29T18:34:31.468Z
---

Review the following guide for setting up an integration between Manufacturing Connect Edge and a MySQL database using SSL authentication.&#x20;

# Before You Begin

You will need the following:

- Access to a MySQL database with SSL authentication.&#x20;
- The CA Certificate and any other required authentication parameters to access the database.&#x20;

You can use the following supported versions:

- MySQL (4.1+)
- MariaDB&#x20;
- Percona Server
- Google CloudSQL
- Sphinx (2.2.3+)

Refer to the following links to learn more:

- [MySQL Docker Image](https://hub.docker.com/_/mysql)
- [MySQL Documentation](https://dev.mysql.com/doc/)
- [Configuring MySQL to Use Encrypted Connections](https://dev.mysql.com/doc/refman/8.0/en/using-encrypted-connections.html)

# Step 1: Add Device

Follow the steps to [Connect a Device](docId\:RFVIJdxz7DBAd8mwbismA). The device will be used to store tags that will be eventually used to create outbound topics in the connector. Make sure to select the **Enable Data Store** checkbox.&#x20;

# Step 2: Add Tags

After connecting the device in Manufacturing Connect Edge, you can [Add Tags](docId\:iOaNZd2AwqnkuppgeE3Eh) to the device. Create tags that you want to use to create outbound topics for the connector.&#x20;

# Step 3: Add the DB - MySQL SSL Connector

Follow the steps to [Add a Connector](docId\:M2niFNAAdyPHcvZWMCOTo) and select the **DB - MySQL SSL&#x20;**&#x70;rovider.&#x20;

Configure the following parameters.&#x20;

- **Name**: Enter a name for the connector.&#x20;
- **Hostname**: Paste the IP address you copied in Step 3. &#x20;
- **Port**: The port needed to access the database. The default value is **3306**.&#x20;
- **CA Certificate**: Paste or upload the CA certificate associated with the database.&#x20;
- **Certificate**: Paste or upload the SSL certificate.&#x20;
- **Private Key**: Enter or paste the SSL private key.&#x20;
- **Username**: Enter the username to access the database.&#x20;
- **Password&#x20;**(Optional): Enter the password associated with the username.&#x20;
- **Database**: Enter the database name. &#x20;
- **Table**: Enter a name to create a new table or enter the name of an existing table.
- **Show Mapping**: Select the check box to display mappings. See [Work with Tables in SQL Connectors (Create Table and Show Mapping)](docId\:FI9mBipRrRIxufdIHwQl9) to learn more. Too add key/value pairs for the custom table, see [Configure Key/Value Pairs](docId\:FI9mBipRrRIxufdIHwQl9).&#x20;
- **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)](docId\:FI9mBipRrRIxufdIHwQl9) to learn more.&#x20;
- **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.&#x20;
- **Throttling limit**: The maximum number of messages per second to be processed. The default value is zero, which means that there is no limit.&#x20;
- **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. &#x20;
- **Queue Mode**: Select the queue mode as **lifo&#x20;**(last in first out) or **fifo&#x20;**(first in first out). Selecting **lifo&#x20;**&#x6D;eans that the last data entry is processed first, and selecting **fifo&#x20;**&#x6D;eans the first data entry is processed first.&#x20;

# Step 4: Enable the Connector

After adding the connector, click the toggle in the connector tile to enable it.&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/weGcj2dsAg9IMiYUCMwJc_mysqlssl.png" size="60" width="415" height="344" position="center" showCaption="false"}

If you see a *Failed&#x20;*&#x73;tatus, you can review the [Connector Logs](docId\:Zz28hZtQBK7oD_Xsj81O8) and relevant error messages.&#x20;

# Step 5: 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.&#x20;

**To create outbound topics:**

1. Click the connector tile.
   The connector *Dashboard&#x20;*&#x61;ppears.&#x20;
2. Click the **Topics&#x20;**&#x74;ab.&#x20;
3. Click the **Import from DeviceHub tags** icon.&#x20;
   The *DeviceHub Import* dialog box appears.
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/QUo-NUFfBj7F2BbnlBBj3_importdevicehub.png" size="80" width="1218" height="567" caption="Import from DeviceHub icon" position="center" showCaption="true"}
4. Select all the tags to import and click **Import**.&#x20;

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

# Step 6: Enable Topics

To enable the topics, return to the Topics tab and click the **Enable all topics** icon.&#x20;

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/HhZpomdNLTdfzY5bZfUUj_enablealltopicsicon.png "Enable all topics icon")

# Step 7: Make MySQL Queries

You can now verify that you can view data in the MySQL database.&#x20;

Update the credentials, database name, and table name to your own specific configurations.&#x20;

**To make MySQL queries:**

1. From the MySQL terminal window, enter `mysql -u user -p` and press **ENTER**.
   *Enter password:&#xA0;*&#x61;ppears.
2. Enter your user password, and then press **ENTER**.
   *Welcome to the MySQL monitor&#xA0;*&#x61;ppears.
3. Enter `show databases;` and press **ENTER**.
   The database name appears.
4. Enter `use sample;`**&#xA0;**&#x61;nd press **ENTER**.
   *Reading table information for completion of table and column names&#xA0;*&#x61;ppears in the console.
5. Enter `show tables;`**&#xA0;**&#x61;nd press **ENTER**.
   The table names for *sample&#x20;*&#x61;ppear.

6. Enter `select * from test_table;`**&#xA0;**&#x61;nd press **ENTER**.
   Data appears from the imported tags for the connector.&#x20;

