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
- Amazon RDS for MySQL — Create an RDS instance
- Azure Database for MySQL — Create an Azure MySQL server
- Google Cloud SQL for MySQL — Create a Cloud SQL instance
- PlanetScale, Aiven, or other managed providers
Option B: Self-Hosted MySQL
- Install MySQL using the official guide.
- Start the MySQL server.
- 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-addressinmy.cnfand 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
| Field | Type | Required | Description |
|---|---|---|---|
host | string | Yes | The MySQL server hostname. |
port | string | Yes | The MySQL server port. Defaults to 3306. |
database | string | Yes | The target database name. |
table_name | string | Yes | The target table name to insert rows into. |
username | string | Yes | The database username for authentication. |
password | secret | Yes | The database password for authentication. |
use_tls | boolean | No | Enable TLS for the connection. Defaults to true. |
Signal Setup
Quick Setup
- Navigate to Integrations in the sidebar.
- Open the Integration Library tab.
- Find MySQL or filter by Cloud Storage.
- Click Install, select a variant if available, and fill in the required fields.
- 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
- Enable the integration in Signal and trigger a test event on your website.
- Connect to the MySQL server and query the target table:
SELECT * FROM datafly_events.events ORDER BY timestamp DESC LIMIT 10;- Verify that event rows are appearing with correct data.
- In Signal, check the Live Events view to confirm delivery status shows as successful.
Troubleshooting
| Problem | Solution |
|---|---|
| Events not appearing in the table | Verify the host, port, database, and table name are correct. |
| Connection refused / timeout | Check that the MySQL server accepts connections from Signal’s IP. Verify firewall rules, security groups, or authorised networks. |
Access denied for user | The username or password is incorrect, or the user cannot connect from Signal’s IP. Verify credentials and user host restriction. |
INSERT command denied | The user lacks INSERT privilege. Run GRANT INSERT ON db.table TO 'user'@'%';. |
Table doesn't exist | The table does not exist in the specified database. Verify the database and table names. |
| TLS connection errors | If use_tls is true, ensure the MySQL server has SSL enabled. For managed services, SSL is typically enabled by default. |
Data too long for column | An event field exceeds the column’s VARCHAR length. Increase the column size or check the data. |
| Character encoding issues | Ensure the table uses utf8mb4 character set and the connection character set matches. |
Visit MySQL documentation for full SQL reference, performance tuning, and replication setup.