You can help by commenting or suggesting your edit directly into the transcript. We'll review any changes before posting them. All comments are completely anonymous. For any comments that need a reply, consider emailing docs@inductiveautomation.com.
Version:
LESSON LIST
-
4:55Connecting to MySQL
-
6:05Connecting to Microsoft SQL Server Express
-
3:32Creating a SQLite Connection
Supplemental Videos
LESSON
Connecting to PostgreSQL
Description
Learn how to connect Ignition to a PostreSQL database.
Video recorded using: Ignition 8.3
Transcript
(open in window)[00:00] In this lesson, we'll connect Ignition to a PostgreSQL database. I already have this kind of database installed on my device, so I'll walk us through how to connect it to Ignition through the gateway webpage. I'm already logged in with my admin user, so we can begin by going to the connections tab and then this connections page under databases. Currently, I don't have any connections, so to add this new one, we can click on the create database connection button. Next, we need to pick the appropriate JDBC driver, which allows Ignition's Java based platform to communicate with databases. Postgres is an option here since it came pre-installed with this version of Ignition, so we can select it and click on Next. There's a few required properties we need to fill out to create the connection, and the first is giving it a name. I'll simply name mine PostgreSQL. Next, we need to add the username and password for the database user we want to connect with. I'm going to use the postgres user that was first created during installation, but this would not be recommended for use in a production environment.
[01:07] Instead, you'd want to create an Ignition user in the database and give them the capability to create tables and write queries. However, since I'm just showing how to create the connection in a testing environment, I'll go ahead and add the postgres user and provide its password with the embedded option. Once you have the credentials typed in, we can scroll down to the Connect URL, and this helps Ignition identify which database to connect to. You can see down below that we'll need to pass in a host, a port, and a database into the string. In my case, I have both Ignition and the database on my device, so I can leave the host name as local host. But if you are connecting to a remote database, you can pass in its host name or IP address. Next I'm using the default port for Postgres, which is 5432, but if you are using a different port, then you can replace this number with your port. Finally, we need to specify the name of the database, and I created one called Ignition. So I'll remove this Postgres text and replace it with the word Ignition, and you would do the same if you had a different named database.
[02:07] After completing the ConnectURL, we have everything needed to create the connection, so we can click on this create database connection button, and we should see a new entry for our database with a valid status.