Common SQL Errors

MySQL Error 2028: CR_WRONG_LICENSE - How to Fix Client Library License Mismatch

Galaxy Team
August 5, 2025

The MySQL client library refuses to connect because its license type does not match the license reported by the target MySQL server.

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 2028 (CR_WRONG_LICENSE)?

MySQL Error 2028: CR_WRONG_LICENSE appears when a commercially licensed or GPL-only client library tries to connect to a server reporting a different license string. Install a client that matches the server’s license, or upgrade both sides to identical Community or Enterprise builds to resolve the issue.

Error Highlights

Typical Error Message

This client library is licensed only for use with MySQL servers having '%s' license

Error Type

Client Error

Language

MySQL

Symbol

CR_WRONG_LICENSE

Error Code

2028

SQL State

Explanation

Table of Contents

What is MySQL error 2028 (CR_WRONG_LICENSE)?

Error 2028 surfaces when a MySQL client library detects that the server’s reported license string does not match the client’s compiled-in license. The client immediately aborts the handshake and returns the message: "This client library is licensed only for use with MySQL servers having '%s' license."

The mismatch usually involves Community (GPL) versus Enterprise (commercial) builds, test builds, or forks that overwrite the license field.

Resolving the conflict restores connectivity and ensures legal compliance.

What Causes This Error?

License string mismatch tops the list. A GPL client talking to a server reporting "commercial" or an Enterprise client hitting a GPL server triggers 2028.

Packaging mistakes, mixed container images, or copying libmysqlclient.so from another host are common root causes.

Custom-compiled forks that changed the LICENSE CMake flag also generate the error because the client believes it is restricted to a specific license phrase.

How to Fix MySQL Error 2028: CR_WRONG_LICENSE

First, confirm the server license with SELECT @@license;. Install or compile a client library built for the same license. On Linux, replace misplaced libmysqlclient* files and clear LD_LIBRARY_PATH.

On Windows, reinstall the Community or Enterprise connector matching the server.

If you intentionally run mixed editions, upgrade both client and server to the latest Community release or purchase Enterprise licenses for all nodes to align the license string.

Common Scenarios and Solutions

Container image drift: a base image shipped with Community client hits an Enterprise server. Redeclare the correct package in the Dockerfile.

Compiled application copied between staging and prod: link the application against the libmysqlclient.so that ships with the target environment or use static linking with the right license at build time.

Best Practices to Avoid This Error

Pin exact MySQL versions and editions in dependency files and CI pipelines. Store client binaries alongside the server build in artifact repositories.

Automate license checks using SELECT @@license during health probes.

In Galaxy, pre-flight connection tests flag edition mismatches before queries run.

Related Errors and Solutions

Error 2054 (ER_HANDSHAKE_ERROR) occurs earlier in the handshake due to protocol mismatches, not licenses. Upgrading client and server to the same major version fixes it.

Error 2003 (CR_CONN_HOST_ERROR) signals basic TCP connectivity issues; verify firewall rules and hostnames instead of licenses.

.

Common Causes

Related Errors

FAQs

Does this error mean I am violating the MySQL license?

Not necessarily, but it indicates your client is restricted to a license type that the server does not match. Aligning editions removes the warning.

Can I bypass the check with a parameter?

No supported option disables the license guard. You must replace the client or server binary.

How does Galaxy prevent this error?

Galaxy runs a pre-connect probe that checks @@license and warns users if the editor’s bundled client mismatches the server edition.

Is the error present in MySQL 8.0?

Yes. The guard exists in all maintained major versions, including 5.7 and 8.0.

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