Skip to end of metadata
Go to start of metadata


In order to get connected to MySQL, your Ignition Gateway must have a Translator, a Driver, and a Connection. New Ignition installations do not have the driver (a JAR file), so you will have to acquire the file yourself. See the JDBC Drivers and Translators page for more details on obtaining the required file. 

Once acquired, you can follow the steps for Upgrading a JDBC Driver. Once the JAR file has been provided, you can follow the steps listed on this page to configure a connection between Ignition and MySQL. 

MariaDB Connections to MySQL Databases 

Alternatively, Ignition can use the built-in MariaDB driver to connect to MySQL 5.7 and prior databases. This circumvents the need to manually provide a JAR file to the MySQL JDBC Driver configuration on the Gateway.  

This feature is new in Ignition version 8.1.2
Click here to check out the other new features

Ignition version 8.1.2 includes a Maria DB driver that can connect to MySQL 8 databases. Note that upgrading Ignition does not replace existing JDBC drivers. See the JDBC Drivers and Translators page for more information.


On this page ...


IULocgo


Connecting to MySQL



Connect Ignition to MySQL Database

  1. On the Gateway Webpage, go to the Config section.
  2. Scroll down to Databases > Connections.


      
  3.  The Database Connections page is displayed. Click on Create new Database Connection....




  4. Select the MySQL ConnectorJ driver and click Next.



    Database connections in Ignition are powered by JDBC drivers. Ignition ships with drivers for Microsoft SQL Server, MySQL, Oracle, and a few others.
     
  5. On the New Database Connection page, enter the following information:

    Name: MySQL (use a meaningful name such as MySQL)
    Connect URL: jdbc:mysql://localhost:3306/test (By default, MySQL creates an empty database called test)




    As you see in the example above, MySQL uses the following Connect URL format:
    jdbc:mysql://hostaddress:3306/database

    Where hostaddress is the address of the machine with MySQL installed, for example: localhost, 192.168.1.1, db-server, etc., and database specifies the database schema the connection will target. It's important to understand that a MySQL server can host many database files. The connection will target one schema (a collection of tables and other objects) in the database.
     

  6. To configure the connection, enter the following information:

    Username: root
    Password: mysql (password is what you entered during MySQL server installation, mysql is the password for this example)
    Extra Connection Properties: Leave at the default value. By default, the zeroDateTimeBehavior parameter is defined and it is usually not necessary to add more parameters unless you are planning to store text outside of the range of 7-bit ASCII (a-z). If you are, add useUnicode=yes;characterEncoding=utf8; to the end of the extra connection properties, including the semi-colons.



  7. Click on Create New Database Connection at the bottom of the form. Your connection is now created and the Database Connections page is displayed showing the Status of your connection as Valid.



  8. To display the details about the status of your database connection, see the Note on the above window and click on the Database Connection Status link. This will display any errors if your status is Faulted, in this example it shows the status as being Valid.



     




  • No labels