Directus: Directus error "🚨 ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server"
This documentation is part of the External databases guide. View the full guide here: How to connect Directus to a MySQL, MariaDB, or PostgreSQL database.
👋 Welcome to the Stackhero documentation!
Stackhero offers a Directus cloud service that is ready for production use in just 2 minutes:
- Unlimited collections, items, users, roles, API requests, and data transfers
- Custom domain name with built-in HTTPS for secure access (for example, https://cms.your-company.com)
- Dedicated email server for unlimited transactional and notification emails
- Integrated Redis cache for high performance
- Consistent performance and strong security with private, dedicated infrastructure
- One-click updates let you keep your system current with minimal effort
Focus on your project, not your setup: you can explore Stackhero's Directus cloud solution in just 5 minutes.
If you see the error 🚨 ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client when using a MySQL server that employs the new caching SHA2 authentication, Directus will not be able to connect properly. The solution is to switch to the traditional native MySQL authentication.
-
If you are using phpMyAdmin, navigate to User accounts, select your Directus user, click Change password, and enter your password. Be sure to choose Native MySQL authentication as the password hashing method.
-
Alternatively, you can run the following SQL commands using the CLI. Replace
directuswith your username andmySecretPasswordwith your chosen password:ALTER USER 'directus'@'%' IDENTIFIED WITH 'mysql_native_password' BY 'mySecretPassword'; FLUSH PRIVILEGES;
Following these steps will help ensure that your Directus installation on Stackhero uses an external database designed for a production environment, offering improved performance and reliability.