Configure ProxySQL query rules to split MySQL reads and writes across hostgroups

domain: proxysql.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Define writer and reader hostgroups in mysql_servers and confirm ProxySQL detects replication topology via monitor user health checks
  2. Insert rules into mysql_query_rules with explicit rule_id ordering, e.g. a high-priority rule routing 'SELECT ... FOR UPDATE' to the writer hostgroup
  3. Add a broader rule matching remaining SELECTs (via match_digest or match_pattern) to the reader hostgroup, setting apply=1 to stop further rule evaluation
  4. Load the rules with LOAD MYSQL QUERY RULES TO RUNTIME and persist them with SAVE MYSQL QUERY RULES TO DISK
  5. Verify routing behavior by querying stats_mysql_query_digest to confirm the observed traffic mix between writer and reader hostgroups

Known gotchas

Related routes

Enable transparent read/write splitting through MySQL Router for an InnoDB Cluster
dev.mysql.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans