Common SQL Errors

MySQL Error 2066: CR_COMPRESSION_WRONGLY_CONFIGURED - How to Fix and Prevent

Galaxy Team
August 5, 2025

Error 2066 signals that the client and server negotiated a compression algorithm that is not enabled or supported on one side of the MySQL connection.

Sign up for the latest in common SQL errors from the Galaxy Team!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

What is MySQL error 2066?

MySQL Error 2066: CR_COMPRESSION_WRONGLY_CONFIGURED means the client asked for a compression algorithm the server does not allow, or vice-versa. Align both sides' compression settings or disable compression to resolve the issue.

Error Highlights

Typical Error Message

Connection failed due to wrongly configured compression algorithm CR_COMPRESSION_WRONGLY_CONFIGURED was added in 8.0.18.

Error Type

Connection Error

Language

MySQL

Symbol

CR_COMPRESSION_WRONGLY_CONFIGURED

Error Code

2066

SQL State

Explanation

Table of Contents

What is MySQL Error 2066: CR_COMPRESSION_WRONGLY_CONFIGURED?

Error 2066 appears during the initial handshake when the client library and the MySQL server cannot agree on a compression algorithm. The message usually surfaces after upgrading to MySQL 8.0.18+, where new algorithms (zstd, lz4, zlib) became negotiable.

The failure terminates the session before authentication, so no SQL reaches the server.

Production services that mandate compression will fail to connect until the mismatch is resolved.

What Causes This Error?

An unsupported algorithm name in the client --compression-algorithms option immediately triggers the error. If the server variable mysql_compression_algorithm or mysqlx_compression_algorithms omits that name, the handshake aborts.

Mixed MySQL versions also cause trouble - a 5.7 client knows only zlib while an 8.0.32 server might default to zstd.

Network proxies that strip capability flags can break the negotiation too.

How to Fix MySQL Error 2066

First, list the algorithms the server permits: SHOW VARIABLES LIKE 'mysql%compression%';. Make sure the client only requests those names. Reload the mysqld variable or restart if you change it.

If alignment is impossible, disable compression with --skip-compression on the client or set compression=OFF in your connector settings.

Galaxy users can edit the connection profile once and share the fix across all teammates.

Common Scenarios and Solutions

Containerized apps often ship an older libmysqlclient. Rebuild the image against the same minor version as the server or add --compression-algorithms=zlib until you upgrade.

MySQL Router in front of InnoDB Cluster might drop the compression capability flag.

Upgrade Router to 8.0.18+ or start it with --compression-algorithms matching the servers.

Best Practices to Avoid This Error

Standardize MySQL minor versions across dev, staging, and prod. Commit the chosen algorithms to configuration management and review them during upgrades.

Monitor failed connection counts in PERFORMANCE_SCHEMA.session_connect_attrs.

Alert when CR_COMPRESSION_WRONGLY_CONFIGURED appears so you can react before users notice.

Related Errors and Solutions

Error 2059 (CR_AUTH_PLUGIN_CANNOT_LOAD) pops up for unsupported auth plugins and is resolved by aligning plugin lists like compression algorithms.

Error 1251 (ER_UNSUPPORTED_AUTH_MODE) indicates a mismatch between the client authentication plugins rather than compression. Upgrade the client or change the user plugin.

.

Common Causes

Related Errors

FAQs

Does the server require a restart after changing compression algorithms?

If you use SET PERSIST, a restart is needed only when the variable is marked restart required. In 8.0.32, mysql_compression_algorithm needs a restart while mysqlx_compression_algorithms does not.

Can I mix zstd and zlib in the same cluster?

Yes. Each connection negotiates independently. Just ensure every node lists both algorithms so any client choice succeeds.

How do I check which algorithm was used for a session?

Query PERFORMANCE_SCHEMA.session_status for the variable COMPRESSION_USED or view the session_connect_attrs table.

Why did the error start after upgrading MySQL?

The upgrade may have altered the default algorithm list. Review release notes for changes and update client options accordingly.

Start Querying with the Modern SQL Editor Today!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Check out some other errors

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo