Skip to main content

Overview

The OneSignal + MySQL integration enables syncing of custom events from your MySQL database to OneSignal to trigger automated messaging campaigns and Journeys based on user behavior. MySQL is a widely-used open-source relational database management system, ideal for storing structured event data that can power personalized messaging campaigns.

Requirements

MySQL

  • MySQL Community 5.7 or later, or recent versions of MariaDB
  • Event tables containing structured behavioral data
  • Network connectivity from OneSignal to your MySQL instance
  • TLS v1.2 or greater supported

Setup

1

Create dedicated user for OneSignal

Create a dedicated user account with read-only permissions:
If you have multiple schemas that contain event data, repeat the GRANT SELECT statement for each schema.
2

Configure OneSignal connection

In OneSignal, go to Data > Integrations and click Add Integration.Select MySQL and provide your connection details:
  • Host: Your MySQL server hostname
  • Port: MySQL port (typically 3306)
  • Database: Database name containing your event tables
  • Username: CENSUS
  • Password: The password you created above
3

Test connection

Click Test Connection to verify OneSignal can successfully connect to your MySQL database and access your event tables.

Event data mapping

Map your to OneSignal’s custom events format:

Example Event Table Schema

Table Mode

Select your event table directly and OneSignal will sync all rows as individual events.

SQL Query Mode

Write custom SQL queries to transform your event data:

Advanced Network Configuration

OneSignal can successfully connect to MySQL instances using advanced networking controls including region constraints, IP address allow lists, or SSH Tunneling. OneSignal supports MySQL with TLS versions 1.2 and greater for secure connections.

FAQ

Which MySQL versions are supported?

OneSignal supports MySQL Community 5.7 or later, as well as recent versions of MariaDB.

Can I connect to MySQL in a private network?

Yes, OneSignal supports SSH tunneling and IP allow lists for connecting to MySQL instances in private networks or behind firewalls.