---
name: prod-mysql-access
description: Remote read-only(+narrow write) MySQL access to PRODUCTION evolution DB from code-server box
metadata: 
  node_type: memory
  type: reference
  originSessionId: a919958d-8286-4e1d-89cd-4ca33d65672e
  modified: 2026-07-20T06:30:39.604Z
---

Remote access to the **production** evolution DB (distinct from [[dev_mysql_access]] which is the local dev MariaDB). Used for [[live_inject_release_notes]].

- Connect: `mysql -h my.evolutionerp.com.au -u claude -p'M15QL2023!_DEV3NV26' -D evolution`
- `my.evolutionerp.com.au` → `118.127.40.55` (server2.coscom.com.au), MariaDB 10.6.24
- **Password rotated** 2026-07-17: current = `M15QL2023!_DEV3NV26` (an earlier `M15QL2023!_R3MTE` is dead).
- Grant is **IP-based**: `claude@202.153.211.134` (this code-server box's static public IP, PTR `202-153-211-134.ca99d3.syd.static.aussiebb.net`).
- No default DB on connect (`DATABASE()` is NULL) — prefix `evolution.` or use `-D evolution`.

Scope: `SELECT` on all `evolution.*` **and all customer tenant DBs** (grant widened 2026-07-20 — tenant read confirmed against `108-1481181613`, `85-1516155235`; the earlier "tenant DBs denied" note is obsolete). `INSERT`/`UPDATE` still ONLY on `evolution.database_queries`, `releasenotes`, `supportTickets`, `supportTicketsEvents`, `supportVideos`. **No writes to tenant DBs** — tenant data fixes (reactivating an invoice row, editing a job) must be done in-app by staff. No DELETE/DDL anywhere. This is PROD — respect [[dev_db_only]] spirit.

**Tenant gotchas (hit 2026-07-20):** each customer DB is named by companyid (e.g. `108-1481181613`); backtick-quote it. PKs are domain-specific: `sites.siteid`, `contacts.clientid` (not `id`). The `log` table has `date` not `timestamp` — a stray `timestamp` column ref errors, and `2>/dev/null` hides it as a silent empty result (verify with `2>&1`). Deleted invoices leave a `log` row `module='invoice', notes='Deleted'` carrying a JSON snapshot → recoverable via [[live_inject_release_notes]]-style path (invoiceadd.inc:42).

**Creds live in `.env` as the `sqlClaude*` trio** (`sqlClaudeHost`/`sqlClaudeUser`/`sqlClaudePasswd`), added 2026-07-17. This trio is **for Claude's own use from the dev box** (reading the creds when running the mysql client) — it is NOT consumed by app code and no `Claude::` DB class exists or should be built. Do NOT reuse the `sqlEvo*` trio for this: `sqlEvo*` backs the live `EVO::` (dbname=evolution) and `ESS_DB::` (dbname=tenant) classes in `library/db.php` plus `apps/api/library/db.php`, and must stay `localhost/root`.

**Gotcha (cost us the first attempt):** a hostname grant `claude@tower.evolutionerp.com.au` fails even though forward DNS is correct, because MariaDB matches the client's **PTR (reverse DNS)**, which returns the aussiebb static name, not `tower...`. Use an **IP-based grant** (survives `skip-name-resolve` and PTR churn).
