Connect MySQL with Statisfy
The MySQL integration lets you import data from any MySQL-compatible database into Statisfy — your application database, an analytics replica, or a MySQL-wire-compatible engine such as MariaDB. Author SQL queries in the Statisfy settings UI, preview results, and schedule them. MySQL uses the same self-serve configuration model as the other warehouse integrations. You can find the shared concepts — query types, account resolvers, transformers, schedules, configuration history — in Integration Concepts. This page focuses on what’s specific to MySQL. Prerequisites:- Admin access to Statisfy
- A MySQL instance reachable from Statisfy’s egress IPs (see Network Access)
- TLS enabled on the MySQL server — Statisfy requires an encrypted connection and refuses to connect otherwise (see TLS requirement)
- A database user with
SELECTaccess on the tables you want to sync
What You Can Import
Set Up the Database User
Run as a MySQL admin user (or any user withCREATE USER and GRANT privileges):
analytics with the database you want Statisfy to read. To restrict the user to specific tables, grant SELECT per table (GRANT SELECT ON analytics.usage_events TO ...) instead of using the wildcard.
Steps to Connect
- Log in to Statisfy.
- Navigate to Integrations → Admin Apps → MySQL → Connect.
-
Enter your connection details:
- Host — DNS name or IP of the database
- Port — Default
3306 - Database — Database name
- Username —
statisfy_reader(or whichever read-only user you created) - Password — The user’s password
- Click Connect.
- Once connected, MySQL will appear as Connected on the Integrations page. To confirm Statisfy can reach MySQL and authenticate, click the gear (Settings) on the card, then Test Connection on the Connection card.
Configure Queries
Open Integrations → MySQL → Settings to:- Browse schemas and tables the user can see, with column types
- Author queries using MySQL SQL with autocomplete and a preview pane
- Map results to Statisfy accounts (via Statisfy account ID, CRM ID, organization ID, email domain, account name, or any custom field) and to fields, metrics, or custom objects
- Apply column transformers (
strip_prefix,regex_extract,lookup, etc.) to reshape values before they’re written - Set the cadence — daily, weekly, monthly, or a sub-day interval (HOURLY through TWELVE_HOURS)
- Run a one-off sync on demand
product_usage, custom_field, or custom_object. See Query types, Account resolvers, and Query configuration dialog for the shared model and how to write, preview, and map a query.
If a schema and table allowlist is saved, Statisfy only lets you save, preview, and browse data inside it. After each sync, check Recent runs for how many rows each query wrote, failed, didn’t match, had nothing to write, or filtered out. See Recent runs.
MySQL-Specific Notes
- Date placeholders. Use
{START_DATE}/{END_DATE_SQL}inWHEREclauses to keep queries incremental. MySQL’sDATE(),DATE_SUB(), andDATE_FORMAT()compose naturally with these. - Database as namespace. MySQL treats “database” and “schema” as the same thing. Queries that reference tables outside the connected database should qualify them explicitly (
other_db.table), and the user needsSELECTon those databases too. - Identifier quoting. MySQL uses backticks (
`column`) rather than double quotes for identifiers that clash with reserved words.
Account Matching
For
custom_field queries that target people instead of accounts, configure a person resolver (email column, optionally name) — Statisfy will upsert the person record by email.
Sync Behavior
Scheduled Jobs:- Each saved query runs on its own cadence.
- The first run after connecting is a bootstrap covering the last 30 days; subsequent runs cover only the active window for the cadence.
- Self-serve configuration takes precedence over any built-in fallback set up by support.
- Per-query errors are logged but do not block other queries from running.
- Invalid rows within a query are skipped and reported in the job audit log.
TLS Requirement
TLS (Transport Layer Security) is the standard protocol for securing a network connection: it encrypts the traffic between two systems and, when fully configured, verifies each side’s identity — so a connection can’t be read or impersonated in transit. Statisfy always connects over TLS. If your server doesn’t accept an encrypted connection, Statisfy refuses to connect rather than sending your credentials and data unencrypted.Statisfy checks that the connection is encrypted, but doesn’t verify the server’s certificate or hostname. Make sure the host you enter is the server you intend to connect to.
require_secure_transport=ON plus a valid certificate on the server) — there is no way to opt out of this requirement.
Network Access
If your MySQL host has IP allowlisting or is in a private network, allow Statisfy’s egress IPs:Security
- Credentials are stored encrypted in Google Cloud Secret Manager.
- Queries authored in the Settings page are read-only — Statisfy validates each query and rejects DDL/DML before save.
- Access is scoped to the database user you provide — grant
SELECTonly on the databases and tables you want Statisfy to read.
Troubleshooting
Connection test fails
Connection test fails
Check network access:
- Verify the host is reachable from the Statisfy egress IPs above
- Confirm the firewall / security group allows inbound traffic on the MySQL port (default
3306)
- Verify host, port, database, username, and password
- Confirm the user’s host pattern allows remote connections (
'statisfy_reader'@'%', not'statisfy_reader'@'localhost')
- Enable TLS on the MySQL server — see TLS Requirement. This is a mandatory configuration, and it needs to be configured by your network admin.
Schema or tables not visible in the browser
Schema or tables not visible in the browser
- Confirm the database user has
SELECTon the tables - System schemas (
information_schema,mysql,performance_schema,sys) are intentionally hidden - New grants may require closing and reopening the schema picker
Query validation errors at save time
Query validation errors at save time
- Statisfy validates queries against the MySQL dialect — vendor-specific functions from other warehouses will be flagged
- DDL (
CREATE,DROP,ALTER) and DML (INSERT,UPDATE,DELETE) are rejected — only read-only queries are allowed - Check the validation error for the offending function or syntax
Records not matching to accounts
Records not matching to accounts
- Verify the resolver column contains values that exist in Statisfy
- For CRM ID resolvers, confirm your CRM integration has synced the matching accounts
- Try a different resolver (switch from account name to email domain) if matching is unreliable
- Add a
regex_extractorstrip_prefixtransformer if the column contains the right ID with extra characters
Sync is slow or impacting production
Sync is slow or impacting production
- Point Statisfy at a read replica instead of the primary
- Lower the cadence to
DAILYso each run scans a smaller window - Use
{START_DATE}/{END_DATE_SQL}to keep queries incremental - Add indexes on the columns you filter on