MySQL error 2026: SSL connection error
The TLS handshake between client and MySQL server failed: a certificate the client won't trust, mismatched TLS versions, or SSL required but disabled.
- Error number
2026- Name
CR_SSL_CONNECTION_ERROR- Category
- Connection and client
What it means
The client and server couldn't set up an encrypted connection. The text after SSL connection error: is the TLS library's reason, for example a certificate verification failure or no common protocol version, and is the part to read.
Common causes
- The client verifies the server certificate (
--ssl-mode=VERIFY_CAorVERIFY_IDENTITY) and the certificate is self-signed or the host name doesn't match. - The client is configured to require TLS and the server has it disabled.
- An old client or server only supports TLS versions the other side has turned off.
- Wrong paths or permissions for the CA, certificate or key files.
How to fix it
-
Check what the server offers.
SHOW VARIABLES LIKE '%ssl%'; SHOW VARIABLES LIKE 'tls_version';
-
Give the client the CA certificate that signed the server's certificate, for example
mysql --ssl-mode=VERIFY_CA --ssl-ca=ca.pem -h db.example.com -u app -p. -
If both sides are old, upgrade the client library rather than re-enabling old TLS versions on the server.
Related errors
3159Insecure transport prohibited2055Lost connection to MySQL server at stage2059Authentication plugin cannot be loaded
More connection and client errors
2002Can't connect through socket2003Can't connect to MySQL server on host2005Unknown MySQL server host2006MySQL server has gone away2013Lost connection to MySQL server during query2061Authentication plugin reported error1251Client doesn't support auth protocol1158Error reading communication packets
The code and message text are from the MySQL 8.4 Error Message Reference. Browse the full MySQL error list or search every database error.
Work on MySQL in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for MySQL and the other databases you use.