Error
Error Code:
70
MySQL Error 70: Option Argument Mismatch
Description
This error indicates that a MySQL command-line option, designed as a simple flag without an argument, was invoked with an unexpected value. It typically occurs when an option that enables or disables a feature is provided with an equals sign and a parameter.
Error Message
%s: option '--%s' cannot take an argument.
Known Causes
3 known causesBoolean Option Misuse
An option intended as a simple flag (e.g., `--verbose`) was provided with an argument (e.g., `--verbose=true`), which it does not accept.
Incorrect Option Syntax
The user provided an argument to an option that explicitly does not accept one, indicating a misunderstanding of its intended usage.
Typographical Error
An accidental equals sign (`=`) or a value was appended to a flag-type option during command input.
Solutions
3 solutions available1. Remove Unnecessary Argument from Option easy
The most common cause is providing an argument to a MySQL option that doesn't expect one.
1
Examine the command or configuration file where the MySQL option is used. Identify the specific option that is causing the error (e.g., `--verbose` or `--help`).
2
If the option is intended to be a flag (e.g., to enable a feature), remove any value or argument that has been accidentally appended to it.
Example: If you have `--verbose=true`, change it to just `--verbose`.
3
If you are modifying a MySQL configuration file (like `my.cnf` or `my.ini`), locate the line with the problematic option and remove the argument.
Before:
[mysqld]
verbose = true
After:
[mysqld]
verbose
4
Re-run your MySQL command or restart the MySQL server with the corrected configuration.
2. Consult MySQL Documentation for Option Usage medium
Verify the correct syntax and expected arguments for the MySQL option in question.
1
Identify the exact MySQL command or configuration setting that is triggering the error message. The error message itself usually indicates the problematic option name.
2
Open your web browser and navigate to the official MySQL documentation for your specific version of MySQL. Search for the option name mentioned in the error message.
Example search query: 'mysql --[option-name] documentation'
3
Carefully read the documentation to understand if the option is a boolean flag (takes no argument) or if it requires a specific type of argument and in what format.
4
Apply the correct usage of the option based on the documentation. This might involve adding, removing, or changing an argument.
3. Review and Correct Shell Script or Application Code medium
If the error occurs within a script or application, the issue lies in how the MySQL client command is constructed.
1
Locate the shell script (bash, sh, etc.) or application code (Python, PHP, etc.) that is executing a MySQL client command.
2
Find the specific command that invokes `mysql` or `mysqldump` and examine the options passed to it.
Example (bash):
mysql -u root -p --host=localhost --port=3306 --verbose=true mydatabase
3
Identify any options that are incorrectly provided with arguments. For instance, `--verbose` should not have `=true` or any other value.
Corrected example:
mysql -u root -p --host=localhost --port=3306 --verbose mydatabase
4
Modify the script or code to use the options correctly, ensuring that flags are provided without arguments and options requiring arguments have them in the correct format.
5
Re-run the script or application.