Connect MySQL
Add a MySQL system and Data Map for deletion plans. TLS, health check, discovery, and dry-run preview.
Connect MySQL
Source: app_docs/guide/connectors.md, app_docs/guide/data-maps.md, app_docs/api.md.
Goal
An enabled MySQL System with a Data Map that can support Rights deletion.
When to use it
User / personal data lives in MySQL and must be deleted via parameterized SQL plans from a Data Map.
Prerequisites
- Organization with Rights access
- Network path from the worker to the database
- Connection string (production: include TLS, e.g.
?ssl=trueor equivalent, unlessSQL_ALLOW_INSECURE=trueon a private network as documented for product deployments)
Steps
Workflow
- Open Rights → Systems (UI:
#/rights/connector). - Add MySQL with connection string (secrets encrypted at rest with
CONNECTOR_SECRETS_KEY/ AES-256-GCM). - Save and run health check (
POST …/connectors/:id/test). - Open Data Map → Discover schema (information schema, capped table set).
- Accept suggestions or add entities: table + identifier columns + DELETE or SKIP.
- Ignore tables that are not personal data.
- Validate until the map is ready (delete without identifiers is invalid).
- Optional: Execution preview, COUNT matching rows only; never deletes.
Connection shape (example form, not a live credential)
mysql://erasure_ro:***@db.example.com:5432/users?ssl=truePermissions (documented guidance)
Least privilege: SELECT (discovery/preview) + DELETE on mapped tables only.
Execution model
Parameterized DELETE FROM … WHERE identifier columns match the subject.
Identifier allowlist (no arbitrary SQL). Discovery table cap applies on large catalogs.
MySQL-specific notes for deletion plans
- Constraint ordering matters. MySQL does not support
DEFERRABLEforeign keys, so each statement is checked immediately. Delete child tables before parents in the map, or the DELETE fails on a constraint. Map ordering should reflect that dependency. - Keep
FOREIGN_KEY_CHECKSon. Disabling it to get around ordering can leave orphaned rows, which are exactly the subject data the deletion is meant to remove. Fix the ordering instead. - Batch large child tables. Deleting a large row set in one statement takes InnoDB range locks that block other writes. Break the work into smaller deletes (the worker's job/retry model keeps each run durable); keep the identifier column indexed so deletes are range-scoped, not full-table scans.
- Count before you delete. Use the execution preview to confirm the match count per table. A count of 0 in a table you expected to hit means the identifier does not resolve there, not that there is nothing to do.
Health statuses
| Status | Meaning |
|---|---|
| HEALTHY | Recent check succeeded |
| DEGRADED | Slow or partial issues |
| UNHEALTHY | Check failed |
| UNKNOWN | Not checked yet |
| DISABLED | Connector off |
API surface (operator session)
| Method | Path |
|---|---|
GET | /api/platform/orgs/:orgId/rights/connectors |
POST | /api/platform/orgs/:orgId/rights/connectors |
POST | /api/platform/orgs/:orgId/rights/connectors/:id/test |
GET | /api/platform/orgs/:orgId/rights/connectors/:id/data-map |
POST | /api/platform/orgs/:orgId/rights/connectors/:id/data-map/entities |
POST | /api/platform/orgs/:orgId/rights/connectors/:id/preview |
v1: one connector per type per organization.
Troubleshoot
| Issue | Check |
|---|---|
| Auth failures | Credentials, rotate secrets (Owner) |
| TLS | Production ssl=true |
| Network | Worker egress / firewall |
| Missing map entities | Discover + map DELETE entities |
| Constraint errors on run | Child-before-parent ordering in the map |
| Count 0 in a mapped table | Identifier mismatch for that table |
Next
Connect PostgreSQL (same map patterns) · Handle a deletion request · Data Maps
Deleting subject data in MySQL at the SQL level is covered in the guide Deleting a user's data from MySQL.