Skip to main content
GrowthBook runs SELECT queries against MySQL or MariaDB to compute experiment results. Create a dedicated read-only user, allow network access from GrowthBook, then add the connection in Metrics and DataData Sources.

1. Create a read-only user

Grant SELECT only on the database that holds experiment assignment and metric events.
Tighten the host in 'growthbook'@'%' if you can restrict the user to the GrowthBook Cloud IP or your self-hosted instance.

2. Allow network access

If you use GrowthBook Cloud, whitelist 52.70.79.40 in your MySQL or MariaDB firewall, security group, or cloud allowlist. Self-hosted GrowthBook runs in Docker. To reach a database on the host machine, use host.docker.internal as the host instead of localhost.

3. Add MySQL or MariaDB in GrowthBook

  1. Go to Metrics and DataData Sources.
  2. Choose MySQL / MariaDB (guided setup if you use a supported event tracker, or manual setup for a custom schema).
  3. Enter the connection fields:
  1. Save. GrowthBook runs a SELECT 1 query to confirm the connection.

4. Map assignments and metrics

After the connection succeeds, define experiment assignment queries and Fact Tables. MySQL and MariaDB support the Schema Browser, so you can inspect tables and columns while writing SQL.