Skip to main content
InSource Solutions

TN - 1362 Connecting to MySQL from Edge

Description

This article from InSource shows how to connect to a MySQL database from Aveva Edge.

  • Author:  Rich Brooks
  • Published:  4/27/2023
  • Applies to: AVEVA Edge v20.0 and higher.

Details

Aveva Edge allows the developer to make database connections.  This tech note steps through creating a connection to a MySQL database.  Start by installing the MySQL Connector NET v8.0.33.  This may be downloaded from mysql.com.  The ODBC connector will not work from Edge.

Next, right click on the Tasks tab found in the Project Explorer of the AVEVA Edge 2020 Studio.  Expand out Database/ERP from the pane on the left.  Right-click on Connections to Insert a new connection.

InsertNewConnection.PNG

The connection requires a connection string in the following format:

Provider=MYSQLCLIENT; Server=<ip address or server name>; Database=<database name>; 

Note:  Do not include the user name and password in the connection string.  Clear text passwords are not allowed.

Enter a Name for the connection.  Type in the connection string using the MySQLClient provider.  Include your IP address or Server Name and Database Name.

DatabaseConnection.PNG

Enter the User Name and Password in the text boxes.  The password will be hidden.  Click on Ok and then save from the toolbar.

NewConnection.PNG

Reference your database connection name from vb scripts.  The example here uses MySQL_DB for the name.

You can now connect and interact with the database from Edge.