unstale

npm / mysql2

mysql2

What changed in mysql2 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.

4 breaking6 security10 new APIs and options7 performance3 behavior and defaults44 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.1.1 on npm

mysql2 374 changes

Breaking changes 4

  • Zero dates with a numeric timezone offset now return INVALID_DATE.

    3.22.1release notes

  • The mysql_clear_password plugin is disabled by default, changing the default authentication behavior.

    3.22.0release notes

  • Query parameters can no longer override connection options defined by the URL, preventing potential configuration injection.

    3.19.1release notes

  • The unsupported CLIENT_DEPRECATE_EOF flag was removed from constants.

    3.16.3release notes

Security 6

  • MySQL2: Unbounded zlib inflate in compressed MySQL protocol handler allows decompression-bomb DoS

    3.23.1security advisoryrelease notes

  • MySQL2: Auth Plugin Downgrade to mysql_clear_password Leaks Plaintext Credentials

    3.22.0security advisory

  • Buffer bounds are validated in the geometry parser to fix a potential denial-of-service vulnerability.

    3.19.1release notes

  • Malformed geometry payloads are handled to fix a potential denial-of-service vulnerability.

    3.19.1release notes

  • Reads are bounded to the packet end, preventing a potential out-of-bounds read.

    3.19.1release notes

  • Resolves a potential SQL injection bypass through objects.

    3.17.0release notes

New APIs and options 10

  • Supports MariaDB UUID, INET4, INET6, VECTOR, and JSON data types via extended type metadata.

    3.23.0release notes

  • COM_RESET_CONNECTION is implemented with pool integration, enabling connection resets in pooled connections.

    3.22.0release notes

  • Exports ExecuteValues from the entry point for use by developers.

    3.21.0release notes

  • Adds support for query attributes.

    3.21.0release notes

  • Exports QueryValues from the entry point for use by developers.

    3.21.0release notes

  • Adds TracingChannel support for native APM instrumentation.

    3.20.0release notes

  • Adds supportBigNumbers, bigNumberStrings, dateStrings, and timezone options to QueryOptions.

    3.18.2release notes

  • Connections, Pools, and Pool Clusters now support Symbol.asyncDispose for asynchronous disposal.

    3.18.0release notes

  • Connections, Pools, and Pool Clusters now support Symbol.dispose for disposal.

    3.18.0release notes

  • BaseConnection adds a getter to track connection lifecycle state.

    3.16.0release notes

Performance 7

  • Performance improvements affect per-query overhead, local dates, short strings, TLS context, and compression.

    3.24.4release notes

  • TLS sessions are reused across connections to the same server.

    3.24.4release notes

  • Outgoing packets use single-pass UTF-8 string encoding, improving performance.

    3.24.1release notes

  • Serializes COM_STMT_EXECUTE in a single exact-size pass.

    3.24.0release notes

  • Removes per-query and per-row allocation hotspots.

    3.24.0release notes

  • Error object creation is deferred to error handlers in promise wrappers, improving performance.

    3.22.0release notes

  • Uses the server's preferred authentication method to eliminate an authentication switch roundtrip.

    3.19.0release notes

Behavior and default changes 3

  • Parameters are typed, and integer types reported by the server are adopted.

    3.24.0release notes

  • When supportBigNumbers is enabled, unsafe integers in JSON columns are returned as exact strings.

    3.23.0release notes

  • The SQL escaper supports Temporal values when escaping values.

    3.23.0release notes

Fixes and other changes 44

  • A new LOCAL INFILE terminator packet is allocated per write.

    3.24.6release notes

  • IPv6 hosts in a connection URI have their brackets stripped.

    3.24.5release notes

  • PoolCluster node events now type nodeId as a string.

    3.24.3release notes

  • Corrects the size used for length-coded numbers in the 3-byte range.

    3.24.2release notes

  • The promise API now honours trace: false on every method.

    3.24.2release notes

  • Fixes zero dates being returned as "undefined 00:00:00" when dateStrings is enabled.

    3.24.0release notes

  • Callback Pool and PoolConnection types now align with runtime behavior.

    3.23.4release notes

  • Leading zeros in TIME fractional seconds are now preserved.

    3.23.4release notes

  • The connection timeout remains active until the handshake completes.

    3.23.3release notes

  • Query-level namedPlaceholders: false is now honored.

    3.23.3release notes

  • Each pooled connection gets its own config copy.

    3.23.3release notes

  • Pool query dispatch errors are propagated instead of thrown.

    3.23.3release notes

  • Corrects the connectAttributes typo in the ChangeUser packet.

    3.23.2release notes

  • A failed execute is no longer left as the active command.

    3.23.2release notes

  • Calls typeCast for NULL values in the binary protocol.

    3.23.1release notes

  • Resolves regressions involving multiple statements and object expansion in the SQL escaper.

    3.22.6release notes

  • Preserves 00:00:00 for TIMESTAMP values in the binary protocol when dateStrings is enabled.

    3.22.5release notes

  • Queued requests are rejected when the pool is ended.

    3.22.4release notes

  • Connection config validation now allows resetOnRelease.

    3.22.3release notes

  • Rejection stacks for the promise API now point at the caller.

    3.22.2release notes

  • Async stack traces now point to the correct source.

    3.22.1release notes

  • Client flags are limited to the capabilities supported by the server.

    3.21.1release notes

  • The boundary check for supportBigNumbers uses Number.isSafeInteger.

    3.21.1release notes

  • Prevents double release from corrupting the connection pool.

    3.20.0release notes

  • Restores PoolConnection as a subclass of Connection.

    3.20.0release notes

  • Fixes precision loss when handling large decimal values.

    3.19.0release notes

  • Improves support for nested parameters in ExecuteValues.

    3.18.2release notes

  • Extends QueryValues to callback-based methods.

    3.18.2release notes

  • Adds support for Raw and Uint8Array parameters.

    3.18.2release notes

  • Adds support for Raw and Uint8Array parameters.

    3.18.2release notes

  • Optional parameters in the query and execute methods are now ensured in the types.

    3.18.1release notes

  • Resolves a potential memory leak in the pool.

    3.17.5release notes

  • Fixes writing the wrong length number to a packet.

    3.17.5release notes

  • Includes @types/node as a peer dependency.

    3.17.5release notes

  • Adds the missing charset encoding for UTF8MB4_0900_BIN.

    3.17.5release notes

  • Fixes types for query values.

    3.17.4release notes

  • Fixes callback and promise resolution for PoolConnection.end.

    3.17.3release notes

  • The pool discards a connection when error 1290 occurs, addressing Aurora read-only failures.

    3.17.2release notes

  • The pool handles all read-only errors during Aurora failover.

    3.17.2release notes

  • Formatting now distinguishes query delimiters from SQL comments, preventing delimiters in comments from being treated as query delimiters.

    3.17.2release notes

  • Object parameters are now expanded after ON DUPLICATE KEY UPDATE preceded by SET.

    3.17.1release notes

  • Adds the missing ConnectionState type to the Promise Connection interface.

    3.16.2release notes

  • Improves handling of mixed and nested quotes in query parsing.

    3.16.1release notes

  • SNI is skipped for IP addresses in TLS connections.

    3.15.3release notes