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).
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 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
- Upgrade PHP (7.4+ / 8.x)
- Or
ALTER USER ... IDENTIFIED WITH mysql_native_password BY '...' - Or start MySQL with
--default-authentication-plugin=mysql_native_password
Detailed fix by platform
MySQL
ALTER USER 'app'@'%' IDENTIFIED WITH mysql_native_password BY 'secret'; FLUSH PRIVILEGES;
How to diagnose
- PHP — Version?
- Plugin — User's auth plugin?
- 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:
Similar errors
- 530 5.7.0 Authentication Required SMTP: 530 5.7.0 Must issue a STARTTLS command first / 530 5.7.1 Authentication required
- 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
- 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
Most viewed in Laravel
- MassAssignmentException Laravel: Illuminate\Database\Eloquent\MassAssignmentException: Add [x] to fillable property to allow mass assignment
- The GET method is not supported for route Laravel: The GET method is not supported for route x. Supported methods: POST (MethodNotAllowedHttpException)
- Livewire: Unable to find component Laravel Livewire: Livewire\Exceptions\ComponentNotFoundException: Unable to find component: [admin.users]
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Report a correction or suggest an improvement
Last updated 4 Nov 2026