Warning
Error Code: 81

MySQL Error 81: Unsigned Option Value Adjusted

📦 MySQL
📋

Description

This warning occurs when a MySQL configuration option, which expects an unsigned integer, is provided with a value that falls outside its permissible range (e.g., negative or exceeding maximum). Instead of rejecting the value, MySQL automatically adjusts it to the nearest valid unsigned limit and proceeds. This informs you that the effective setting might not be what was explicitly configured.
💬

Error Message

option '%s': unsigned value %s adjusted to %s.
🔍

Known Causes

3 known causes
⚠️
Incorrect System Variable Setting
A global or session MySQL system variable was set to a negative number or a value exceeding its maximum unsigned limit, causing MySQL to coerce it.
⚠️
Invalid Configuration File Value
A setting in a MySQL configuration file (e.g., my.cnf or my.ini) for an unsigned option was outside its valid range, leading to an automatic adjustment during server startup.
⚠️
Application-Level Misconfiguration
An application or script attempted to set a MySQL option with an out-of-range unsigned value, triggering the server to adjust it internally.
🛠️

Solutions

3 solutions available

1. Adjust Configuration Value to be Unsigned easy

Modify the MySQL configuration to use a valid unsigned integer for the problematic option.

1
Identify the specific option and values mentioned in the error message. The error message format is 'option '%s': unsigned value %s adjusted to %s.' The first '%s' is the option name, the second is the original value, and the third is the adjusted value.
2
Locate your MySQL configuration file. This is typically `my.cnf` or `my.ini` and can be found in locations like `/etc/mysql/my.cnf`, `/etc/my.cnf`, or within your MySQL installation directory.
3
Edit the configuration file using a text editor.
sudo nano /etc/mysql/my.cnf
4
Find the section containing the problematic option (e.g., `[mysqld]`).
5
Modify the value of the option to be a valid unsigned integer. The error message usually indicates the adjusted value, which is the correct unsigned value. For example, if the error is 'option 'max_connections': unsigned value -1 adjusted to 100.', you would change 'max_connections = -1' to 'max_connections = 100'.
max_connections = 100
6
Save the configuration file and exit the editor.
7
Restart the MySQL service for the changes to take effect.
sudo systemctl restart mysql

2. Use `SET GLOBAL` for Runtime Adjustments easy

Temporarily adjust the option value directly on the running MySQL server without modifying configuration files.

1
Connect to your MySQL server using a client like the `mysql` command-line tool or a GUI tool.
mysql -u root -p
2
Identify the option and the correct unsigned value from the error message. The error message 'option '%s': unsigned value %s adjusted to %s.' will provide the option name and the adjusted, valid unsigned value.
3
Execute a `SET GLOBAL` statement to change the option's value. Replace `option_name` and `unsigned_value` with the actual values from the error message.
SET GLOBAL option_name = unsigned_value;
4
Example: If the error is 'option 'innodb_buffer_pool_size': unsigned value 0 adjusted to 134217728.', you would run:
SET GLOBAL innodb_buffer_pool_size = 134217728;
5
Verify the change by querying the global variables.
SHOW GLOBAL VARIABLES LIKE 'option_name';
6
Note: This change is temporary and will be lost upon MySQL server restart. To make it permanent, you must also update the MySQL configuration file as described in the 'Adjust Configuration Value to be Unsigned' solution.

3. Review MySQL Version Specifics and Defaults medium

Understand if the option's default or expected type has changed across MySQL versions.

1
Identify the MySQL server version you are running.
SELECT VERSION();
2
Consult the official MySQL documentation for your specific version regarding the option mentioned in the error message. Search for the option name (e.g., 'max_connections', 'innodb_buffer_pool_size').
3
Pay close attention to the data type expected for the option. Some options that were historically signed integers might have become unsigned in newer versions, or vice-versa, or have specific range limitations.
4
If the error indicates an unexpected negative value was provided for an option that should strictly be unsigned, it might be due to a misconfiguration or a value carried over from a previous, incompatible configuration.
5
Based on the documentation, ensure the value you are setting in your configuration file or attempting to set at runtime adheres to the unsigned integer requirements and any documented minimum/maximum limits.
🔗

Related Errors

5 related errors