1977
MySQLERRORNotableConfigurationHIGH confidence

Variable cannot be set to the value of given expression

Production Risk

Low — set statement is rejected; current value is unchanged.

What this means

The value provided to SET for a system variable is not accepted. This happens when the value is out of range, the wrong type, or not in the set of allowed values for that variable.

Why it happens
  1. 1Setting an ENUM-like variable to an unlisted string value.
  2. 2Setting a numeric variable to a value outside its valid range.
  3. 3Setting sql_mode to an unknown mode name.
How to reproduce
trigger — this will error
trigger — this will error
SET GLOBAL binlog_format = 'INVALID_FORMAT';

expected output

ERROR 1231 (42000): Variable 'binlog_format' can't be set to the value of 'INVALID_FORMAT'.

Fix

Use a valid value for the variable

Use a valid value for the variable
SET GLOBAL binlog_format = 'ROW'; -- valid values: ROW, STATEMENT, MIXED

Why this works

Check the MySQL documentation for the list of valid values for each system variable.

Sources
Official documentation ↗

MySQL 8.0 — 1977 ER_WRONG_VALUE_FOR_VAR

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

← All MySQL errors