The MySQL client library refuses to connect because its license type does not match the license reported by the target MySQL server.
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.
This client library is licensed only for use with MySQL servers having '%s' 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.
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.
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.
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.
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.
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.
.
Not necessarily, but it indicates your client is restricted to a license type that the server does not match. Aligning editions removes the warning.
No supported option disables the license guard. You must replace the client or server binary.
Galaxy runs a pre-connect probe that checks @@license
and warns users if the editor’s bundled client mismatches the server edition.
Yes. The guard exists in all maintained major versions, including 5.7 and 8.0.