1975
MySQLERRORCommonConfigurationHIGH confidence

Variable is a GLOBAL variable

Production Risk

Low — set statement is rejected; no configuration change occurs.

What this means

An attempt was made to set a variable using SET SESSION (or the session-level syntax) when the variable can only be changed at the global level.

Why it happens
  1. 1SET SESSION innodb_buffer_pool_size = ... on a variable that is global-only.
  2. 2Using SESSION scope qualifier on a variable that only supports GLOBAL scope.
How to reproduce
trigger — this will error
trigger — this will error
SET SESSION innodb_buffer_pool_size = 134217728;

expected output

ERROR 1229 (HY000): Variable 'innodb_buffer_pool_size' is a GLOBAL variable and should be set with SET GLOBAL.

Fix

Use SET GLOBAL for global-only variables

Use SET GLOBAL for global-only variables
SET GLOBAL innodb_buffer_pool_size = 134217728;

Why this works

Global-only variables affect the entire server and must be set at the global scope.

Sources
Official documentation ↗

MySQL 8.0 — 1975 ER_GLOBAL_VARIABLE

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MySQL errors