Closed Lloople closed 4 years ago
I suspect this will need to be fixed in MySQL-Kit first before being added to Fluent. I think passing an empty string is not the same as passing nothing, but it depends on how MySQL works. I'm going to hook @gwynne in here as she's done a ton of work on MySQL auth recently
Had to test this to be sure, but it turns out that no additional effort at the MySQLKit or MySQLNIO layer is required - in MySQL, "no password" and "the password is an empty string" are the same thing.
I will post a review with further comments.
On further investigation, the difference between 5.7 and 8.0 turns out to be due to 8.0 using caching_sha2_password
as the default instead of mysql_native_password
. The bug here is actually at the MySQLNIO layer, which incorrectly encodes a complete auth response for an empty password ""
, when the correct behavior for the mysql_native_password
plugin is to encode no auth response at all in that case. The existing behavior is already correct for the caching SHA-2 plugin.
As such, this PR is unnecessary; I am closing it out in favor of the one I'm about to open against MySQLNIO. @Lloople Your effort and contributions are very much appreciated, and my closing this PR out is in no way intended to discourage you! Please don't hesitate to open new issues and PRs in the future; they are always welcome- this one definitely served to point me in the right direction to fix the problem!
Thank you very much for your time and for such an explanation about the issue! 😍 I'll try my best to continue helping with anything I can
I'm very new to both Swift and Vapor, but I'm trying my best here so sorry about any possible mistake 🙏.
I tried to add a test for this scenario but I don't know enough yet 😅.
This fixes #195 . I don't have a password on my local environment for the MySQL user and I was unable to run migrations, this is why I think this change should be addressed.
Thank you for your time and framework.