MySQL client error 2072 (CR_INVALID_FACTOR_NO) occurs when the numeric value passed to MYSQL_OPT_USER_PASSWORD is not 1, 2, or 3.
MySQL Error 2072 (CR_INVALID_FACTOR_NO) means the factor supplied to MYSQL_OPT_USER_PASSWORD is outside the valid range of 1-3. Pass 1, 2, or 3 – or omit the option – to resolve the problem quickly.
Invalid first argument for MYSQL_OPT_USER_PASSWORD option. Valid value should be between 1 and 3 inclusive. CR_INVALID_FACTOR_NO was added in 8.0.27.
Error 2072 is raised by the MySQL client library when an application calls mysql_options() with MYSQL_OPT_USER_PASSWORD and supplies a factor number that is not 1, 2, or 3. The option was introduced in MySQL 8.0.27 to support multi-factor authentication.
The client aborts the connection attempt immediately, so no packets reach the server.
Applications using outdated connectors or mistaken configuration strings encounter this issue most often.
Invalid numeric factors trigger the fault. Any value below 1 or above 3 – including 0, 4, or negative numbers – violates the API contract. String values will also fail because the client casts them to zero.
Mismatched client and server versions can surface the bug when the client expects three factors but the server is pre-8.0.27.
Copy-pasted example code that hard-codes an incorrect factor is another frequent cause.
Always pass a valid factor integer (1, 2, or 3) when you enable MYSQL_OPT_USER_PASSWORD. Validate user input before supplying it to mysql_options(). Upgrade old connectors so they understand the new option flags.
If you are not using multi-factor authentication, remove the MYSQL_OPT_USER_PASSWORD call entirely.
This immediately eliminates the risk.
Compiled C applications that link against libmysqlclient 8.0.27 or later often fail after a library upgrade. Rebuild the code and ensure the factor comes from a safe enum or constant.
Language drivers such as Connector/C++ or Python MySQL Connector can expose the option through connection strings (e.g., factor=4).
Edit the connection URL to a legal factor or drop the property.
Encapsulate authentication settings in a well-typed configuration object rather than raw integers. Unit-test edge cases to confirm only 1-3 are accepted. Monitor application logs for CR_-prefixed errors and alert early.
Galaxy’s typed connection manager surfaces only valid factor choices in its UI, preventing developers from saving invalid values.
Use Galaxy to manage and share vetted connection strings securely.
Error CR_UNKNOWN_OPTION (2054) occurs when an unsupported option flag is passed. Verify option names against the client version. Error CR_SSL_CONNECTION_ERROR (2026) arises from TLS failures; ensure certificates and ciphers align.
.
8.0.27 added multi-factor support and stricter validation. Code that silently accepted invalid factors now fails fast.
No. The client aborts before network I/O, so the session never starts. You must fix the factor value.
It is purely a client-side validation error. The server never receives the packet.
Galaxy’s connection form restricts factor selection to 1-3 and stores connections centrally, eliminating typos.