set_global_variable
Set a global MySQL variable safely: captures the prior value for rollback, supports dry-run preview, and refuses lockout-causing settings.
Instructions
[WRITE][risk=medium] SET GLOBAL a server variable. Reversible: captures prior value.
Runtime-only: the change does not survive a restart (persist it in my.cnf — or SET PERSIST on MySQL 8 — yourself); reported but NOT performed automatically. The prior value (from SHOW GLOBAL VARIABLES) is captured so the harness records an undo that sets it back. Pass dry_run=True to preview.
Refuses the globals that would lock this tool out of the server (init_connect, max_connections, max_user_connections, read_only, super_read_only, skip_networking, require_secure_transport, and wait_timeout/interactive_timeout below 30s). SET GLOBAL is immediate, so those strand the undo. Enforced under dry_run too.
Args: name: The global variable name (e.g. max_connections). value: The new value (as a string). dry_run: If True, preview without changing. target: Target name from config; omit for the default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| value | Yes | ||
| target | No | ||
| dry_run | No |