// MySQL error reference

MySQL error 3159: Insecure transport prohibited

The server has require_secure_transport turned on and the client connected without TLS. Connect with TLS or a local socket.

Error number
3159
Name
ER_SECURE_TRANSPORT_REQUIRED
SQLSTATE
HY000
Category
Connection and client
Error message
Connections using insecure transport are prohibited while --require_secure_transport=ON.

What it means

With require_secure_transport = ON, MySQL accepts only connections using TLS, a Unix socket or shared memory. A plain TCP connection is accepted at the network level but rejected at login with 3159. Many managed MySQL services turn this on by default.

Common causes

  • A client or driver with TLS disabled (--ssl-mode=DISABLED, useSSL=false).
  • An old client that doesn't negotiate TLS.
  • Connecting through a tool configured to never use TLS.

How to fix it

  1. Enable TLS in the client, for example mysql --ssl-mode=REQUIRED -h db.example.com -u app -p, or your driver's TLS option.

  2. If you control the server and the network is trusted, you can turn the requirement off.

    SET PERSIST require_secure_transport = OFF;

Related errors

More connection and client errors

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.

// fewer errors, faster fixes

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.