in reply to Reading host from defaults file with DBD::mysql

I ran into this issue a few years back and was never able to resolve it. Since then I've just always specified the host in the dsn string. Below is an example script where the first case without specifying host=$host fails, but the second case with host=$host succeeds. Any pointers appreciated. It wasn't obvious to me where in DBD/mysql.pm it was reading the config file. I did step through the debugger forever, until it failed to connect, but never saw where it was reading the config file.
#!/bin/env perl use warnings; use strict; use DBI; my $db = "****"; my $host = "****"; my $cfg_file = "/tmp/my.cnf"; my ($dsn, $dbh); print STDERR "Without host=\$host\n"; $dsn = "dbi:mysql:mysql_ssl=1;database=$db;mysql_read_default_file=$cf +g_file;mysql_read_default_group=test_group"; $dbh = DBI->connect($dsn); print STDERR "\nWith host=\$host\n"; $dsn = "dbi:mysql:mysql_ssl=1;database=$db;mysql_read_default_file=$cf +g_file;mysql_read_default_group=test_group;host=$host"; $dbh = DBI->connect($dsn); print "\$dbh = $dbh\n";
outputs:
Without host=$host DBI connect('mysql_ssl=1;database=****;mysql_read_default_file=/tmp/my +.cnf;mysql_read_default_group=test_group','',...) failed: Can't conne +ct to local MySQL server through socket '/var/run/mysql.sock' (2) at +/tmp/test_db.pl line 12. With host=$host $dbh = DBI::db=HASH(0xa00318a18)
The /tmp/my.cnf looks like:
[test_group] host=**** port=3306 database=**** user=**** password=**** no-auto-rehash ssl=1

Update: This is on a cygwin system with the latest cygwin based perl and associated modules. I just tried it on a linux system and it works without specifying host=$host