// MySQL error reference

MySQL error 1251: Client doesn't support auth protocol

The server asked for an authentication method the client is too old to speak. Upgrade the client or driver, or change the account's plugin.

Error number
1251
Name
ER_NOT_SUPPORTED_AUTH_MODE
SQLSTATE
08004
Category
Connection and client
Error message
Client does not support authentication protocol requested by server; consider upgrading MySQL client

What it means

During login the server tells the client which authentication method to use. A client library that predates it, such as the old mysql package for Node.js talking to MySQL 8's caching_sha2_password, can't continue and reports 1251.

Common causes

  • An old driver or client library connecting to MySQL 8.0 or later.
  • The Node.js mysql package, which doesn't support caching_sha2_password; mysql2 does.
  • Very old clients that only know the pre-4.1 password hashing.

How to fix it

  1. Upgrade the client or driver (for Node.js, move to mysql2).

  2. Check the account's plugin.

    SELECT user, host, plugin FROM mysql.user WHERE user = 'app';
  3. As a stopgap where the server still allows it, switch the account to mysql_native_password. It is deprecated, and disabled by default in MySQL 8.4.

    ALTER USER 'app'@'%' IDENTIFIED WITH mysql_native_password BY 'password';

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.