Re: DBI:mysql -> using .my.cnf

From: Dave Brown (dhbrown_at_hobbes.dhbrown.net)
Date: 04/19/04


Date: Mon, 19 Apr 2004 07:05:04 GMT

In article <slrnc82jsn.241.dhbrown@hobbes.dhbrown.net>, Dave Brown wrote:
> I'm trying to connect to a database "ipp", and rather than hardcode the
> password, I'm trying to have the .my.cnf file read. According to some
> google-surfing, the following should work:
>
> #!/usr/bin/perl -w
> # connect only, using .my.cnf
> use DBI;
> my $dsn = "DBI:mysql:ipp;mysql_read_default_file=$ENV{HOME}/.my.cnf";
> my $dbh = DBI->connect($dsn,undef,undef,{RaiseError => 1})
> or die "$0: can't connect: $DBI::errstr\n";
> $dbh->disconnect;
> ...
>
> (I'm running on Linux, perl 5.6.1, DBI-1.21, DBD-MySQL-1.2219.)

Do enough google-searching, and you finally get an answer...

It turns out it was a bug in MySQL server, v. 3.23.49, which was
distributed with RedHat 7.3. It was fixed with a later versions,
(rpmfind.net has 3.23.58).

-- 
Dave Brown  Austin, TX


Relevant Pages