4 years ago
Attempting to use a Node application with the database I created in Railway, I get the error:
⛔️ Connection test failed: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
This is caused by the fact that the mysql
Node package most JavaScript ORMs use does not yet support MySQL 8.x password authentication (it's been sitting in a pull request since 2018). You can enable backward compatibility in MySQL itself, however.
In the attached screenshot you'll see how Digital Ocean does this currently with their managed databases. They give you a simple option to change the database user's password encryption type.
Without this change, most Node apps using MySQL aren't going to run on your platform.
3 Replies
4 years ago
Hey Daniel Sieradski!
Thanks for the suggestion and example from DO. We'll look into it.
In the meantime though, you can manually alter the authentication method for the database. You can see an example in our Ghost starter.
4 years ago
Hey Daniel Sieradski!
Thanks for the suggestion and example from DO. We'll look into it.
In the meantime though, you can manually alter the authentication method for the database. You can see an example in our Ghost starter.
Faraz Patankar: Thanks!
4 years ago
Like Faraz Patankar mentioned, you can get around this using the same mechanism we use for Ghost.
Full disclosure; we likely won't be implementing this natively as we'd err on the side of "You should use the latest and greatest, ESPECIALLY when it comes to security"
That's my initial reaction at least. For now, the Ghost workaround should be suitable but would love to hear what the use case is if it's something else that won't be resolved by the above
Status changed to Archived jake • over 3 years ago