4 months ago
Moved my database to EU servers. Had to update MYSQL to new version to fit with EU Servers.
However, Now i get: Plugin 'mysql_native_password' is not loaded.
I am unable to get onto the server to change the authentication plugin for my MySQL user from mysql_native_password to caching_sha2_password.
Site currently down in the meantime.
Pinned Solution
4 months ago
something like this railway ssh --service <mysql-service>
it will connect you to the database.
17 Replies
4 months ago
Im reverting back to US servers for now. As the site has been down too long, but would like to get an idea on how to fix this so we can revert back to EU servers.
seemus
Im reverting back to US servers for now. As the site has been down too long, but would like to get an idea on how to fix this so we can revert back to EU servers.
4 months ago
That didnt make any difference
4 months ago
You could add --mysql-native-password=ON to the Custom Start Command or environment variables in your Railway MySQL service settings. But i am not sure if it will work.
4 months ago
Also what version of MySQL are you using? 8? 9?
diogoribeirodev
Also what version of MySQL are you using? 8? 9?
4 months ago
Not entirely sure what its loaded up but looks like 9
seemus
Not entirely sure what its loaded up but looks like 9
4 months ago
MySQL Server 8.4.8-1.el9
4 months ago
Yeah in that version mysql_native_password is no longer supported
4 months ago
A solution would be to downgrade to 8.4 where it's still supported.
diogoribeirodev
Yeah in that version **mysql\_native\_password is** no longer supported
4 months ago
Yes I need to change the authentication plugin for my MySQL user from mysql_native_password to caching_sha2_password. - Any ideas?
4 months ago
You can run:
Run this to get the users that are using the old plugin:
SELECT User, Host, plugin FROM mysql.user WHERE plugin = 'mysql_native_password';
Then update the root user to use the caching_sha2_password plugin, i think you can leave the old password:
ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'new_password';
Using caching_sha2_password will require you to use a library compatible with it, like in nodejs you will need to use mysql2 instead of mysql.
diogoribeirodev
You can run: Run this to get the users that are using the old plugin: `SELECT User, Host, plugin FROM mysql.user WHERE plugin = 'mysql_native_password';` Then update the root user to use the `caching_sha2_password` plugin, i think you can leave the old password: `ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'new_password';` Using `caching_sha2_password` will require you to use a library compatible with it, like in nodejs you will need to use `mysql2` instead of `mysql`.
4 months ago
How do I run that if I cannot connect to the database?
4 months ago
You don't have access to the database/railway project?
4 months ago
I have access to railway via CLI, but I cannot connect to the database due to ERROR 1524 (HY000): Plugin 'mysql_native_password' is not loaded
4 months ago
You can use railway ssh to connect to the railway service ( database )
4 months ago
something like this railway ssh --service <mysql-service>
it will connect you to the database.
4 months ago
Great, we are in and solved. Thanks a bunch!
4 months ago
You're welcome!
Status changed to Solved sam-a • 4 months ago