1984
MariaDBERRORNotableConfigurationHIGH confidence
Variable is global or local only
Production Risk
Low — statement is rejected; no configuration is changed.
What this means
An attempt was made to set a system variable at the wrong scope. Some variables are GLOBAL only and cannot be set as SESSION, and vice versa.
Why it happens
- 1Using SET SESSION for a GLOBAL-only variable.
- 2Using SET GLOBAL for a SESSION-only variable.
- 3Omitting the scope qualifier when the variable requires one.
How to reproduce
trigger — this will error
trigger — this will error
SET SESSION innodb_buffer_pool_size = 134217728; -- GLOBAL only
expected output
ERROR 1984 (HY000): Variable 'innodb_buffer_pool_size' is a GLOBAL variable and should be set with SET GLOBAL.
Fix
Use the correct scope qualifier
Use the correct scope qualifier
SET GLOBAL innodb_buffer_pool_size = 134217728;
Why this works
Matching the scope to the variable type satisfies the constraint.
What not to do
✕
Sources
Official documentation ↗
MySQL 8.0 — 1984 ER_INCORRECT_GLOBAL_LOCAL_VAR
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev