Skip to main content
Data Management
PI System
Technology

How to Connect Your PI AF with MySQL and MariaDB Using Linked Tables

Learn how to connect MySQL and MariaDB databases to PI Asset Framework using vendor-specific ODBC drivers, ensuring seamless data integration.

Roshan Soni

4 min read

How to Connect Your PI AF with MySQL and MariaDB Using Linked Tables

Integrating and connecting databases is a critical aspect of effective data management and utilization. In the era of big data, connecting different databases seamlessly ensures that data from various sources can be leveraged without friction. In particular, connecting MySQL or MariaDB databases to PI Asset Framework (AF) can be crucial for organizations using PI System as they aim to consolidate and analyze operational data.

In this post, we explore how you can achieve this connection, focusing on overcoming challenges related to driver compatibility and installation.

The Challenge

Consider a scenario where you are tasked with connecting a MySQL or MariaDB database to your PI AF system. Despite successfully enabling remote connections and having been able to connect to the database using Python's pyodbc package from a 64-bit computer, integrating it with PI AF can be challenging due to driver compatibility issues.

Initially, attempts to connect using various available drivers prove futile. This situation is not uncommon, as PI AF (like many systems) requires specific configuration to work seamlessly with external databases.

The Solution: Using Vendor-Specific ODBC Drivers

The breakthrough comes with the realization that both MySQL and MariaDB offer their own vendor-specific ODBC drivers, which are not only compatible but necessary for establishing a connection to PI AF via linked tables.

Here's a step-by-step guide to setting up the connection:

  1. Download the Correct ODBC Driver:

  2. Install the Driver on the AF Server:

    • Follow the specific installation instructions provided by the driver manufacturer. These may differ significantly from the installation process for other database drivers, such as OSIsoft's standard drivers.
  3. Configure the Linked Table in PI AF:

    • Once the driver is installed, configure your PI AF to recognize the ODBC driver and set up the linked table. This may require specifying the driver in the connection string and providing the necessary database credentials.
  4. Test the Connection:

    • Verify the connection by attempting to access a table or view data through your configured linked table in PI AF. Troubleshoot any errors by ensuring your configuration settings align with the database's connection requirements.

Benefits of a Successful Connection

By linking MySQL or MariaDB tables to your PI AF, you enable a more seamless integration of data flows into your operations. This connection allows users to leverage existing databases without the need for complex and error-prone data exports or transformations, enhancing the speed and reliability of data-driven decision-making.

Conclusion

Connecting MySQL or MariaDB to PI AF through linked tables demonstrates the importance of using correct vendor-specific drivers and following detailed installation instructions. By ensuring the right driver compatibility, organizations can unlock the full potential of their operational data, enabling more efficient and informed decision-making processes.

By thoughtfully integrating these databases within your data infrastructure, you set the stage for enhanced data accessibility and analytics capabilities, driving enterprise success.

Tags

#PI System
#Data Integration
#MySQL
#MariaDB
#ODBC Drivers

About Roshan Soni

Expert in PI System implementation, industrial automation, and data management. Passionate about helping organizations maximize the value of their process data through innovative solutions and best practices.

Sign in to comment

Join the conversation by signing in to your account.

Comments (0)

No comments yet

Be the first to share your thoughts on this article.

Related Articles

Enhancing PI ProcessBook Trends with Banding and Zones: User Needs, Workarounds, and the Road Ahead

A look at the user demand for trend banding/zoning in OSIsoft PI ProcessBook, current VBA workarounds, UI challenges, and how future PI Vision releases aim to address these visualization needs.

Roshan Soni

Migrating PIAdvCalcFilVal Uptime Calculations from PI DataLink to PI OLEDB

Learn how to translate PI DataLink's PIAdvCalcFilVal advanced calculations—like counting uptime based on conditions—into efficient PI OLEDB SQL queries. Explore three practical approaches using PIAVG, PIINTERP, and PICOunt tables, and get tips for validation and accuracy.

Roshan Soni

Understanding PI Web API WebID Encoding: Can You Generate WebIDs Client-Side?

Curious about how PI Web API generates WebIDs and whether you can encode them client-side using GUIDs or paths? This article explores the encoding mechanisms, current documentation, and best practices for handling WebIDs in your applications.

Roshan Soni