Skip to main content

MySQL

MySQL is a widely used open-source relational database. DataBridge supports MySQL as an event destination for teams that use MySQL as their primary data store.

Connect via Cloud Mode

In Cloud mode, DataBridge connects directly to your MySQL instance.

  1. Go to Data Stores and click Connect New
  2. Select MySQL
  3. Keep the connection mode set to Cloud (default)
  4. Fill in the connection details:
    • Name - a display label (e.g., "MySQL Production")
    • Host with port - hostname and port (e.g., mysql.example.com:3306)
    • Username and Password
    • Database - target database name (e.g., analytics)
  5. Click Test Connection to verify connectivity
  6. Click Save

Connect via DataBridge Agent

In Agent mode, the DataBridge Agent handles the connection from within your infrastructure.

  1. Go to Data Stores and click Connect New
  2. Select MySQL
  3. Switch the connection mode to Agent
  4. Fill in:
    • Name - a display label
    • Connection Alias - must match an alias defined in the agent's config.yaml
  5. Click Save

Configuration Reference

NameRequiredDescriptionDefault
HostYesDatabase hostname (without port)localhost
PortYesDatabase port3306
SSL ModeYesConnection encryption: disable or requiredisable
DatabaseYesTarget database namedefault
UsernameYesDatabase username
PasswordYesDatabase password
SchemaYesDatabase schema

Schema-Driven Column Types

When a JSON Schema is registered for an event, DataBridge maps each top-level property to a native MySQL column type:

JSON Schema TypeMySQL Column Type
stringTEXT
string with format: "date-time"DATETIME(3)
integerBIGINT
numberDOUBLE
booleanBOOLEAN
objectJSON
arrayJSON

Every table also includes two metadata columns: ref_url_id TEXT and event_id TEXT.

Nested objects and arrays are stored as native JSON columns, supporting MySQL's JSON functions for querying. If no schema is registered, the table falls back to the simplified three-column layout (ref_url_id, event_id, payload).

Required Permissions

The MySQL user needs permission to create and write tables in the target database:

GRANT CREATE, INSERT, ALTER, SELECT ON analytics.* TO 'databridge_user'@'%';
FLUSH PRIVILEGES;

Testing the Connection

In Cloud mode, click Test Connection in the connection dialog before saving.

In Agent mode, verify from the agent host:

mysql -h your-mysql-host -P 3306 -u databridge_user -p analytics

Troubleshooting

Connection timed out

  • Verify the host and port are correct
  • Check that MySQL's bind-address allows remote connections
  • Ensure firewall rules or security groups allow traffic on port 3306
  • For managed services (RDS, Cloud SQL, etc.), check the instance is accessible

Authentication failed

  • Confirm the username and password
  • Check the user has access from the connecting host: SELECT host, user FROM mysql.user;
  • For remote connections, the user must be granted access from % or the specific DataBridge IP

TLS / SSL errors

  • If your database requires TLS, set SSL Mode to require
  • If TLS is not configured on the server, set SSL Mode to disable
  • For managed databases, TLS is often required by default

Character set issues

  • DataBridge uses utf8mb4 by default, which supports the full Unicode range
  • Ensure your database and tables use a compatible character set

Tips

  • Use a dedicated database for DataBridge event tables to keep them separate from application data
  • For AWS RDS or Google Cloud SQL, use require SSL mode for encrypted connections
  • MySQL 8.0+ is recommended for best compatibility