-
Notifications
You must be signed in to change notification settings - Fork 74
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
Bad Handshake error #320
Comments
DBD::mysql is built against libmysqlclient on the local machine. Perhaps install a version of that matching the remote mysql servers, and then see https://metacpan.org/pod/distribution/DBD-mysql/lib/DBD/mysql/INSTALL.pod#SOURCE-INSTALLATION for how to build against it. |
Hello @ibrierley! Meanwhile could you try DBD::MariaDB driver? We are running basic test suite of DBD::MariaDB driver compiled with new versions of MySQL and MariaDB clients against of the old MySQL 4.1.22 and MySQL 5.1.72 server versions and everything pass. So connecting with DBD::MariaDB compiled with recent version of client should be able to connect to old 4.1 or 5.1 servers. |
Hi, Swapping in DBD::MariaDB rather than DBD::mysql still fails for me with 'bad handshake' still, that's connecting to a 5.1.73 server. It's not impossible something else has gone astray, but I'm not sure of anything else to try on the client aspect of it. But I'm guessing from what Grinnz has said, it would still have the same problem, i.e is it using libmysqlclient still ? |
If connecting with DBD::MariaDB fails too, could you provide perl code which you use to connect? And also whole output? |
Sure...
This is also the same with my $dsn = 'DBI:mysql:database=mydb;host=myhost.domain.net'; Just a note, connecting the other way is fine, from an old server I can connect (using mysql) to a new mariadb 10.3 server without a handshake error. |
What is the exact version of mysql client version and mysql server version? |
mysql server 5.1.73
|
If you have not used pre-compiled DBD::MariaDB, then in build log of DBD::MariaDB you should see path to either If you have installed client library via package manager, then ask your package manager for version of installed package which provides that library file /usr/lib64/mysql/libmysqlclient.so.21.1.17 |
I can't find anything that specifically lists that file (or any specific version)....closest I can get is
yum info mysql-devel
|
Just going back to Grinnz comment, how would one install a different version of libmysqlclient ? Struggling to find info on that. |
Thanks for details, important parts are: Seems that it is truth that in default configuration of MySQL 8.0.17 client does not allow connection to 5.1 servers. So compiling DBD::MariaDB either with mariadb client library or mysql 5.7 (or older) should help. Anyway, even mysql 8.x client library should be able to connect to older mysql servers, but it would need some modifications in DBD::MariaDB driver. Please report this issue to our DBD::MariaDB issue tracker https://github.com/gooddata/DBD-MariaDB/issues and we can look at it. |
FWIW, we had the same issue establishing a connection from perl on Ubuntu jammy to an older mysql 5.1.41. Just switching to DBD::MariaDB fixed that problem for us. The libdbd-mariadb-perl package is not available in jammy right now so we rolled our own package based on debian sid, but switched the build dependencies so it built with libmariadb3 instead of libmysqlclient. See also https://bugs.launchpad.net/ubuntu/+source/libdbd-mariadb-perl/+bug/1971711 |
I've got the same problem.
Client:
mysql command works just fine, but perl script fails, no matter which driver: mysql or mariadb
|
We never got this working, so ended up working on 5.7.38 enabled in our Centos (now Rocky) repos rather than Mariadb as an interim measure, but that hits end of support in Oct/23 so worth being aware there (but should be easier to migrate to 8 then iirc). |
db is on production server, can't just upgrade it right away :( |
Here is an update for this issue. I wrote details to comment: perl5-dbi/DBD-MariaDB#156 (comment) |
I've got a new Centos 8 install, with Perl 5.30.1 and I think DBD::mysql 4.050 connecting via DBI.
I am trying to connect to some old servers that are running mysql 5.1. When I try and connect I get a "bad handshake" error (when I look using strace). Reading around, typically it seems to be version mismatches with mysql.
I am unsure what dictates this, is it an underlying mysqllib on the Centos box, or something in the Perl version.
Does anyone have any ideas how to get around it, or what we'd need to downgrade to be able to connect to the other mysql servers ?
The text was updated successfully, but these errors were encountered: