Error
Error Code:
3558
MySQL Error 3558: Invalid Function Option Key
Description
MySQL Error 3558, "Invalid option key '%s' in function %s," indicates that a function was called with an option key that it does not recognize or support. This error typically occurs when executing SQL statements involving functions or stored procedures that accept key-value pair arguments, and one of the provided keys is malformed, misspelled, or simply not valid for that specific function.
Error Message
Invalid option key '%s' in function %s.
Known Causes
3 known causesTypo or Misspelling
An option key was misspelled, leading the function to not recognize the intended parameter.
Unsupported Option
An option key was provided that is not supported by the specific MySQL function or its current version.
Incorrect Syntax
The option key was provided using incorrect syntax or formatting expected by the function's definition.
Solutions
3 solutions available1. Correcting Function Option Spelling easy
Ensures that all function option keys are spelled correctly and match the expected syntax.
1
Review the SQL statement that is generating the error. Identify the function call and its associated options.
2
Compare the option keys used in your query against the documented options for the specific MySQL function you are using. Pay close attention to spelling, case sensitivity (though MySQL function options are generally case-insensitive, it's good practice to match documentation), and hyphens/underscores.
3
Correct any misspelled option keys in your SQL query.
Example: If you intended to use `max_length` but typed `mx_length`, correct it to `max_length`.
2. Verifying Function Support and Syntax medium
Confirms that the function and its options are supported in your MySQL version and adhere to the correct syntax.
1
Consult the official MySQL documentation for the specific version you are running. Search for the function that is causing the error.
2
Within the function's documentation, carefully examine the list of available options and their correct syntax. Ensure that the option key you are using is indeed a valid parameter for that function.
3
If the option key is not listed or is marked as deprecated/removed in your version, you will need to find an alternative or update your query to use a supported option.
4
Double-check the overall syntax of the function call. For instance, ensure options are properly delimited (e.g., using commas or spaces as required by the function).
3. Checking for Typographical Errors in Function Names easy
Identifies and corrects any misspellings in the function name itself.
1
Locate the function call in your SQL statement that is triggering the error.
2
Carefully spell-check the function name. It's easy to make a typo, especially with less common or complex function names.
3
Compare the function name in your query with the correct name as per MySQL documentation.
Example: If you intended to use `JSON_EXTRACT` but typed `JSON_EXTACT`, correct it.