When connecting a MySQL 8 or MySQL 8.4 (LTS) database to Embeddable, you may encounter the following error:
ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server
This happens because MySQL 8+ uses caching_sha2_password as its default authentication plugin, while Embeddable connects successfully using mysql_native_password.
How to Check Your MySQL Version and Authentication Plugin
You can confirm your MySQL version and user authentication method with:
SELECT VERSION();
SELECT user, host, plugin FROM mysql.user WHERE user = 'your_user';
If:
-
Your version is 8.x (especially 8.4), and
-
The
plugincolumn showscaching_sha2_password,
then this is the cause of the connection failure.
Solution: Create a user/ Alter existing user with mysql_native_password
To connect Embeddable to MySQL 8/8.4, create a user that uses mysql_native_password instead of the default authentication method as mentioned here.
In MySQL 8.4, mysql_native_password is disabled by default and you must enable it at the MySQL server level.
If MySQL is installed on a server or VM
-
Edit your MySQL configuration file (commonly one of the following):
-
/etc/my.cnf -
/etc/mysql/my.cnf -
/etc/mysql/mysql.conf.d/mysqld.cnf
-
-
Under the
[mysqld]section, add:
mysql_native_password=ON
- Restart MySQL:
sudo systemctl restart mysqld
or
sudo systemctl restart mysql
If MySQL is running in Docker
Start the container with native authentication enabled:
--mysql-native-password=ON
(Refer to your container configuration for where to add this option.)
If Using a Managed Service (e.g., RDS, Cloud SQL)
Some managed MySQL services may restrict authentication plugin configuration.
Consult your provider’s documentation to determine whether mysql_native_password can be enabled or whether users can be created explicitly with that plugin.
Step 2: Create a Native Authentication User
Once mysql_native_password is enabled, create a new user:
CREATE USER 'emb_user'@'%' IDENTIFIED WITH mysql_native_password BY 'your_password';
GRANT ALL PRIVILEGES ON your_database.* TO 'emb_user'@'%';
FLUSH PRIVILEGES;
or alter your existing user:
ALTER USER 'emb_user'@'%' IDENTIFIED WITH mysql_native_password BY 'your_password';
GRANT ALL PRIVILEGES ON your_database.* TO 'emb_user'@'%';
FLUSH PRIVILEGES;
Step 3: Use This User in Embeddable
Configure your Embeddable connection using:
-
Host
-
Database
-
Port (typically 3306)
-
Username:
emb_user -
Password: your password
The connection should now succeed.