0
votes

I am trying to set up Perl to connect to a mysql database. i am using Perl 5.16, as this is a requiment, DBI 1.622 with DBD:mysql from cpan was build. The mysql database is Version 5.6.26 The mysql database uses SHA256 authentication, this won't be changed and there must not be set up an account with old_authentication or native. I can not connect to the database as it replies with Client authentication scheme is not supported. My short test script is

use DBI;
use DBD::mysql;

$dbh = DBI->connect('DBI:mysql:host=dbhost', 'dbtest', 'test'
           ) || die "Could not connect to database: $DBI::errstr";

The returned error message is

DBI connect('host=dbhost,'dbtest',...) failed:  Client does not support authentication
protocol requested by server; consider upgrading MySQL client at dbtest.pl line 4.

Could not connect to database: Client does not support authentication protocol requested
by server; consider upgrading MySQL client at dbtest.pl line 4.

How can i set up a Connection to the Server?

edit : This is not a duplicate. The User is allowed to access from any host, and we do not want to roll back to old Password, as written above

1
Check which versions on the MySQL dev libraries you have, these are separate to the server, you may have old ones. See: search.cpan.org/~capttofu/DBD-mysql-4.032/lib/DBD/mysql/… - martin clayton
@serenesat I had read your link before posting the question. Host for the user is set to %, Communication via mysql workbench from the same host executing the script is possible. This is not the solution for my problem - chenino
@martinclayton, i will check this and report back afterwards - chenino

1 Answers

0
votes

@martinclayton is correct. You have a very old version of your PERL MySQL DBD module. The upgrade to 4.1 happened over a decade ago.

Read this: https://dev.mysql.com/doc/refman/5.5/en/old-client.html

You need to upgrade your DBD module. Martin's link will give you some hints how to do it. http://search.cpan.org/~capttofu/DBD-mysql-4.032/lib/DBD/mysql/INSTALL.pod#PREREQUISITES