Error
Error Code:
68
MySQL Error 68: Unknown Command-Line Option
Description
MySQL Error 68, 'unknown option '--%s'.', indicates that the MySQL server or a MySQL client utility encountered an unrecognized command-line flag or parameter. This error typically occurs when starting `mysqld`, running client programs like `mysql` or `mysqldump`, and an invalid option is provided.
Error Message
unknown option '--%s'.
Known Causes
3 known causesTypographical Error
A common reason is a simple spelling mistake, incorrect casing, or an extra character in the option name passed to MySQL utilities or the server.
Unsupported Option
The specified option may not exist in your specific MySQL version, or it is not applicable to the particular client or server executable being used.
Incorrect Syntax
The option was provided with an incorrect format, such as missing an equals sign for a value, using a single hyphen for a long option, or improper spacing.
Solutions
3 solutions available1. Correct Typo in Command-Line Option easy
Identify and fix a misspelled option in your MySQL command.
1
Carefully review the command-line arguments you are passing to the MySQL client or server. Look for any typos or incorrect option names.
2
Consult the MySQL documentation for the correct option names and syntax. For example, if you intended to use `--ssl-ca`, but mistyped it as `--ssl-cae`, correct it.
mysql --ssl-ca=/path/to/ca.pem -u myuser -p mydatabase
3
Re-run your MySQL command with the corrected option.
2. Verify MySQL Version Compatibility medium
Ensure the command-line option is supported by your MySQL version.
1
Determine the version of your MySQL client and server. You can often find this by running `mysql --version` or `mysqld --version`.
mysql --version
2
Check the MySQL documentation specific to your version to confirm if the command-line option you are using is valid and supported. Some options are introduced or deprecated across different versions.
https://dev.mysql.com/doc/
3
If the option is not supported in your version, either remove it, replace it with an equivalent option for your version, or upgrade your MySQL installation if the functionality is critical.
3. Check for Unintended Options in Scripts or Configuration medium
Inspect scripts or configuration files for erroneous command-line arguments.
1
If you are running MySQL via a script (e.g., a shell script, a systemd service file, or a startup script), examine the script for any hardcoded command-line options passed to `mysql` or `mysqld`.
Example systemd service file snippet:
[Service]
ExecStart=/usr/sbin/mysqld --user=mysql --datadir=/var/lib/mysql --log-error=/var/log/mysql/error.log --invalid-option
2
Also, review your MySQL configuration files (e.g., `my.cnf`, `my.ini`) for any options that might be incorrectly specified or that are being passed as command-line arguments when they should be in the configuration file.
Example my.cnf snippet:
[mysqld]
ssl-ca = /path/to/ca.pem
# invalid-option = value
3
Remove or correct any incorrect or unsupported options found in these files and restart the MySQL service or re-run the script.
sudo systemctl restart mysql