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 Data → Data Sources.
1. Create a read-only user
GrantSELECT only on the database that holds experiment assignment and metric events.
'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, whitelist52.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
- Go to Metrics and Data → Data Sources.
- Choose MySQL / MariaDB (guided setup if you use a supported event tracker, or manual setup for a custom schema).
- Enter the connection fields:
- Save. GrowthBook runs a
SELECT 1query to confirm the connection.

