1231: Variable can't be set to the value of ...
MySQLWhat does it mean?
The value being assigned to a system/session variable (with SET) is invalid. The value was rejected because it is outside the allowed set, of the wrong type or in an unsuitable format.
Why does it happen?
Common examples: assigning an invalid/misspelled mode name to sql_mode, giving an undefined option to an enum variable, or assigning NULL to a variable that does not accept NULL. Numeric values in the wrong unit/range can also trigger it.
How to fix it
Verify the valid values and type the variable accepts; for ENUM/SET-type variables (e.g. sql_mode, which is a SET), spell value/mode names exactly and separate multiple values with commas. Check the valid value range in the documentation. For lists such as sql_mode, read the current value (SELECT @@sql_mode) and add/remove items safely on top of it.