SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client Laravel Origin: Application & API Last updated 4 Nov 2026

Laravel: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client [caching_sha2_password]

The PHP MySQL driver doesn't support the authentication plugin MySQL 8 uses (caching_sha2_password).

Exact message you may see SQLSTATE[HY000] [2054] The server requested authentication method unknown to the clientThe server requested authentication method unknown to the client [caching_sha2_password]caching_sha2_password could not be loadedSQLSTATE[HY000] [2054] caching_sha2_password
Seen on: Laravel PHP MySQL

Meaning

Use a PHP/MySQLnd version that supports it (PHP 7.4+), or change the user to the older plugin: ALTER USER 'app'@'%' IDENTIFIED WITH mysql_native_password BY 'pass';. Docker MySQL 8 with old PHP images triggers this frequently; updating PHP is the better fix.

Common causes

  • PHP older than 7.4 with MySQL 8
  • mysqlnd/libmysql too old
  • User created with caching_sha2_password
  • Old PDO driver in a legacy Docker image
  • Mixed MariaDB/MySQL client versions

⚡ Quick fix

  1. Upgrade PHP (7.4+ / 8.x)
  2. Or ALTER USER ... IDENTIFIED WITH mysql_native_password BY '...'
  3. Or start MySQL with --default-authentication-plugin=mysql_native_password

Detailed fix by platform

MySQL

  1. ALTER USER 'app'@'%' IDENTIFIED WITH mysql_native_password BY 'secret'; FLUSH PRIVILEGES;

How to diagnose

  1. PHP — Version?
  2. Plugin — User's auth plugin?
  3. Docker — MySQL 8 image?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

530 5.7.0 Authentication Required — SMTP: 530 5.7.0 Must issue a STARTTLS command first / 530 5.7.1 Authentication required (Email / SMTP)530 5.7.0 Authenticat…534 5.7.9 Application-specific password required — SMTP: 534-5.7.9 Application-specific password required. Learn more at https://support.google.com/accounts/answer/185833 (Email / SMTP)534 5.7.9 Application…535 5.7.8 Username and Password not accepted — SMTP: 535-5.7.8 Username and Password not accepted. Learn more at https://support.google.com/mail/?p=BadCredentials (Email / SMTP)535 5.7.8 Username an…Attempt to read property "x" on null — Laravel/PHP 8: ErrorException: Attempt to read property "name" on null (Laravel)Attempt to read prope…Authentication token manipulation error — passwd: Authentication token manipulation error (Linux)Authentication token …Command "x" is not defined — Laravel: Symfony\Component\Console\Exception\CommandNotFoundException: Command "make:livewire" is not defined. Did you mean one of these? (Laravel)Command "x" is not de…DKIM: body hash did not verify — DKIM: dkim=fail (body hash did not verify) / signature verification failed (Email / SMTP)DKIM: body hash did n…DMARC fail: SPF and DKIM not aligned — DMARC: dmarc=fail (p=REJECT) — SPF and DKIM pass but domains are not aligned with the From header (Email / SMTP)DMARC fail: SPF and D…SQLSTATE[…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.