MySQL

Datafly Signal delivers events to MySQL for widely adopted, high-performance relational database storage with broad ecosystem support.

Prerequisites

Before configuring MySQL in Signal, you need a MySQL server (self-hosted or managed), a database and table, and a user with INSERT privileges.

Set Up a MySQL Server

You have several options:

Option A: Managed MySQL

Option B: Self-Hosted MySQL

  1. Install MySQL using the official guide.
  2. Start the MySQL server.
  3. Ensure the server is accessible from your Signal infrastructure on port 3306.

Configure Network Access

Ensure your MySQL server accepts connections from Signal’s IP addresses:

  • RDS: Configure the security group inbound rules.
  • Azure: Add firewall rules in the Networking tab.
  • Cloud SQL: Add authorised networks.
  • Self-hosted: Configure the bind-address in my.cnf and firewall rules.

Create a Database and Table

Connect to the MySQL server and create the target database and table:

CREATE DATABASE datafly_events;
 
USE datafly_events;
 
CREATE TABLE events (
  event_id VARCHAR(64) NOT NULL PRIMARY KEY,
  type VARCHAR(20),
  event VARCHAR(256),
  anonymous_id VARCHAR(64),
  user_id VARCHAR(256),
  timestamp DATETIME(3),
  received_at DATETIME(3),
  sent_at DATETIME(3),
  context JSON,
  properties JSON,
  traits JSON,
  source_id VARCHAR(64),
  integration_id VARCHAR(64),
  INDEX idx_timestamp (timestamp DESC),
  INDEX idx_type_event (type, event)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

Using utf8mb4 character set ensures full Unicode support. The JSON column type allows flexible querying with MySQL’s JSON functions (e.g. JSON_EXTRACT, ->).

Create a User for Signal

CREATE USER 'datafly_signal'@'%' IDENTIFIED BY 'your_secure_password';
GRANT INSERT ON datafly_events.events TO 'datafly_signal'@'%';
FLUSH PRIVILEGES;
⚠️

Replace '%' with Signal’s specific IP address or CIDR range for tighter security. The % wildcard allows connection from any host.

Configuration

FieldTypeRequiredDescription
hoststringYesThe MySQL server hostname.
portstringYesThe MySQL server port. Defaults to 3306.
databasestringYesThe target database name.
table_namestringYesThe target table name to insert rows into.
usernamestringYesThe database username for authentication.
passwordsecretYesThe database password for authentication.
use_tlsbooleanNoEnable TLS for the connection. Defaults to true.

Signal Setup

Quick Setup

  1. Navigate to Integrations in the sidebar.
  2. Open the Integration Library tab.
  3. Find MySQL or filter by Cloud Storage.
  4. Click Install, select a variant if available, and fill in the required fields.
  5. Click Install Integration to create the integration with a ready-to-use default blueprint.

API Setup

curl -X POST http://localhost:8084/v1/admin/integration-catalog/mysql/install \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "MySQL",
    "variant": "default",
    "config": {
      "host": "db.example.com",
      "port": "3306",
      "database": "datafly_events",
      "table_name": "events",
      "username": "datafly_signal",
      "password": "your_secure_password",
      "use_tls": true
    },
    "delivery_mode": "server_side"
  }'

Testing

  1. Enable the integration in Signal and trigger a test event on your website.
  2. Connect to the MySQL server and query the target table:
SELECT * FROM datafly_events.events ORDER BY timestamp DESC LIMIT 10;
  1. Verify that event rows are appearing with correct data.
  2. In Signal, check the Live Events view to confirm delivery status shows as successful.

Troubleshooting

ProblemSolution
Events not appearing in the tableVerify the host, port, database, and table name are correct.
Connection refused / timeoutCheck that the MySQL server accepts connections from Signal’s IP. Verify firewall rules, security groups, or authorised networks.
Access denied for userThe username or password is incorrect, or the user cannot connect from Signal’s IP. Verify credentials and user host restriction.
INSERT command deniedThe user lacks INSERT privilege. Run GRANT INSERT ON db.table TO 'user'@'%';.
Table doesn't existThe table does not exist in the specified database. Verify the database and table names.
TLS connection errorsIf use_tls is true, ensure the MySQL server has SSL enabled. For managed services, SSL is typically enabled by default.
Data too long for columnAn event field exceeds the column’s VARCHAR length. Increase the column size or check the data.
Character encoding issuesEnsure the table uses utf8mb4 character set and the connection character set matches.

Visit MySQL documentation for full SQL reference, performance tuning, and replication setup.