Subject: | Cannot use secure_auth=0 option for legacy DB connections |
Date: | Mon, 20 Jan 2014 12:16:07 +0000 |
To: | bug-DBD-mysql [...] rt.cpan.org |
From: | Karl Royer <karlroyer [...] corp.cardboardfish.com> |
The MYSQL_SECURE_AUTH option cannot be set to 0 using the DBD::mysql client,
The following diff to dbdimp.c (DBD-mysql-4.025) permits the
"mysql_insecure_auth=1" option to be permitted in the connection string
which will set the MYSQL_SECURE_AUTH option to false.
diff -r DBD-mysql-4.025/dbdimp.c DBD-mysql-4.025.modded/dbdimp.c
39a40,41
Show quoted text
> my_bool secure_auth = 0;
>
1704a1707,1715
Show quoted text> if ((svp = hv_fetch(hv, "mysql_insecure_auth", 19, FALSE))
> && *svp && SvTRUE(*svp))
> {
> if (DBIc_TRACE_LEVEL(imp_xxh) >= 2)
> PerlIO_printf(DBIc_LOGPIO(imp_xxh),
> "imp_dbh->mysql_dr_connect: Setting" \
> " secure auth (0).\n");
> mysql_options(sock, MYSQL_SECURE_AUTH,&secure_auth);
> }
This has been tested using the connection URI
DBI->connect("DBI:mysql:host=$host;mysql_insecure_auth=1:database=$database'',
$username, $password)