-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handshake error connecting from client 8.0.17 to mysql server 5.1.7 #156
Comments
Same issue. Any updates? |
I gave up with Perl and Mariadb in the end, bit of a shame. I ended up removing mariadb and installing mysql on centos. I also ran an older version of mysql in a docker container in some cases to transition versions. |
Here is an update: #190 New mysql 8.x client versions use by default new authentication method not supported by the older mysql servers. Older servers support Example how to use this new my $dbh = DBI->connect("DBI:MariaDB:$db", $user, $pass, { mariadb_auth_plugin => 'mysql_native_password' }); @cBrou or @ibrierley or @ShyLionTjmn Could you test this change if it helps for you? |
Above mentioned pull request add an option MySQL 8.x client library ignores the MySQL client library since version 8.0.4 uses by default So when MySQL 8.0.4+ client library try to connect to MySQL pre-5.5.7 servers (which do not support This is a clear bug in MySQL 8.0.4+ client library and I have not found any way how to workaround it without patching client library itself. Here is the proper fix for the MySQL 8.x client library which is part of the MySQL server package: --- mysql8/sql-common/client.cc 2023-07-23 15:21:07.545622792 +0200
+++ mysql8/sql-common/client.cc 2023-07-23 15:37:47.929255681 +0200
@@ -3954,7 +3956,14 @@ int run_plugin_auth(MYSQL *mysql, char *
mysql, auth_plugin_name, MYSQL_CLIENT_AUTHENTICATION_PLUGIN)))
DBUG_RETURN(1); /* oops, not found */
} else {
- auth_plugin = &caching_sha2_password_client_plugin;
+ /*
+ * If CLIENT_PLUGIN_AUTH capability is not announced by server (pre-5.5.7)
+ * then only the old native_password_client_plugin is supported by server.
+ */
+ if (mysql->server_capabilities & CLIENT_PLUGIN_AUTH)
+ auth_plugin = &caching_sha2_password_client_plugin;
+ else
+ auth_plugin = &native_password_client_plugin;
auth_plugin_name = auth_plugin->name;
}
With this change also command line You should report this bug to the MySQL developers or Oracle support channel. |
As here is modified patch for the MySQL 8.0.26+: --- mysql8/sql-common/client.cc 2023-07-23 15:52:40.715822119 +0200
+++ mysql8/sql-common/client.cc 2023-07-23 15:54:02.628415270 +0200
@@ -5759,8 +5759,13 @@ static mysql_state_machine_status authsm
if (ctx->auth_plugin_name == nullptr || ctx->auth_plugin == nullptr) {
/*
If everything else fail we use the built in plugin
+ If CLIENT_PLUGIN_AUTH capability is not announced by server (pre-5.5.7)
+ then only the old native_password_client_plugin is supported by server.
*/
- ctx->auth_plugin = &caching_sha2_password_client_plugin;
+ if (mysql->server_capabilities & CLIENT_PLUGIN_AUTH)
+ ctx->auth_plugin = &caching_sha2_password_client_plugin;
+ else
+ ctx->auth_plugin = &native_password_client_plugin;
ctx->auth_plugin_name = ctx->auth_plugin->name;
}
|
This mysql bug is already tracked in mysql issue tracker: https://bugs.mysql.com/bug.php?id=90994 |
After discussion with MySQL developers, this MySQL 8 client library issue should be fixed in the upcoming October MySQL 8.0.35 release (I guess in the next week). With that fixed release it should be able to connect to the MySQL pre-5.5.7 servers with MySQL 8 client library again. |
Great, thanks for the update. |
Should be fixed in upstream by mysql/mysql-server@f05a2da |
It should be part of MYSQL versions 8.0.35 and 8.2.0 |
Can anyone please verify it's OK now? |
See also this issue...
perl5-dbi/DBD-mysql#320 (comment)
Which has a stack trace, version info etc.
The text was updated successfully, but these errors were encountered: