How-To Guides
Integration Guides
MySQL Integration Guide
10 min
review the following guide for setting up an integration between belden horizon data operations and a mysql database user scenario in this guide you will deploy a mysql database container from belden horizon data operations 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 belden horizon data operations , 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 https //hub docker com/ /mysql https //dev mysql com/doc/ step 1 add device follow the steps to docid\ t cwpe0 jsfw5 aoj8wpp 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 check box step 2 add tags after connecting the device in belden horizon data operations, you can docid\ wpe2hmxelarlbnhwbuchy to the device create tags that you want to use to create outbound topics for the connector step 3 add mysql marketplace application note the version used in this use case for mysql version is 8 0 see the https //dev mysql com/doc/refman/8 0/en/ for more information to add the mysql marketplace application in belden horizon data operations, navigate to applications > marketplace click marketplace list and select default marketplace catalog click the mysql application tile from the installation script version drop down list, select latest 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 click launch navigate to applications > catalog apps the mysql application appears, pulls the image, and then starts the application the mysql application shows as running navigate to applications > containers the mysql application container is running copy the ip address for the mysql application step 4 add the db mysql connector follow the steps to docid\ orxib vla2ngvdx94z1ow 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 if you are sending data to an existing table, use the corresponding name show mapping if you want to send data to a custom table, select this check box and unselect create table see docid\ k18pbzznvdkrjn y u193 to learn more to add key/value pairs for the custom table, see docid\ k18pbzznvdkrjn y u193 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 check box and unselect show mapping see docid\ k18pbzznvdkrjn y u193 to learn more commit timeout transaction commit timeout (ms) max transaction size maximum number of messages before a transaction is committed regardless of timeout bulk insert size to enable this option, enter the number of messages to group together and send as one bulk insert statement enabling this option can improve how quickly data is processed when dealing with high volumes of tags available for belden horizon data operations 3 11 1 and later 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 belden horizon data operations 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 if you see a failed status, review the docid\ ocbqwycy xmmkwv9aunq and any 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 to create outbound topics click the connector tile the connector dashboard appears click the topics tab click the import from devicehub tags icon the devicehub import dialog box appears select all the tags to import and click import 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 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 in belden horizon data operations, navigate to applications > containers click the terminal icon next to the mysql container the mysql shell opens from the mysql container terminal, enter mysql u user p and press enter enter password appears enter your user password, and then press enter welcome to the mysql monitor appears enter show databases; and press enter the database name appears enter use sample; and press enter reading table information for completion of table and column names appears in the console enter show tables; and press enter the table names for sample appear enter select from test table; and press enter data appears from the imported tags for the connector