[Bioperl-l] DBI connection parameters and BasePersistenceAdaptor.pm

Amit Indap indapa at gmail.com
Thu Aug 25 17:36:10 EDT 2005


Hi,

Thanks for the response on the the bioperl-db API, Hilmar. I have a
much better understanding now.

I have a script that adds features to bioentries in a biosql database
(namely where bioentries align to the human genome via parsinga blat
file).  But its having trouble connecting to my mysql db when I call
my $dbseq= $adp->find_by_unique_key($seq);
(where $seq holds my Bio::Seq object to which I want to add features
to) The stack is listed at the end of the msg.

I would like to add features to this sequence and then store them in
my biosql database while  encapsulating this process using bioperl-db
API. Clearly, it can't connect to my mysql server  The particular line
in  BasePersistenceAdaptor.pm it flames out on is:
$dbh=$dbc->dbi()->get_connection($dbc,$dbc->dbi()->conn_params($self))


Elswhere in my code I have a low-level query for my biosql db using
DBI in which I connect to mysql reading a .my.cnf file:

my $conn = DBI->connect("DBI:mysql:amit" .
";mysql_read_default_file=/home/amit/.my.cnf", $user, $passwd);

Is there a way for to tell bioperl to read this .my.cnf file when it
makes its database connection? For some reason to open a mysql
connection on my machine i need to open up a ssh -L connection to the
machine where the mysql server lives  with some funky parameters. (If
this is more appropriate for biosql mailiing list, apologies but I
didn't want to cross post :)

Amit Indap
Cornell University

------------- EXCEPTION  -------------
MSG: failed to open connection: Access denied for user
'amit'@'132.236.170.104' (using password: NO)
STACK Bio::DB::DBI::base::new_connection
/usr/lib/perl5/site_perl/5.8.5/Bio/DB/DBI/base.pm:253
STACK Bio::DB::DBI::base::get_connection
/usr/lib/perl5/site_perl/5.8.5/Bio/DB/DBI/base.pm:213
STACK Bio::DB::BioSQL::BasePersistenceAdaptor::dbh
/usr/lib/perl5/site_perl/5.8.5/Bio/DB/BioSQL/BasePersistenceAdaptor.pm:1477
STACK Bio::DB::BioSQL::BaseDriver::prepare_findbyuk_sth
/usr/lib/perl5/site_perl/5.8.5/Bio/DB/BioSQL/BaseDriver.pm:515
STACK Bio::DB::BioSQL::BasePersistenceAdaptor::_find_by_unique_key
/usr/lib/perl5/site_perl/5.8.5/Bio/DB/BioSQL/BasePersistenceAdaptor.pm:927
STACK Bio::DB::BioSQL::BasePersistenceAdaptor::find_by_unique_key
/usr/lib/perl5/site_perl/5.8.5/Bio/DB/BioSQL/BasePersistenceAdaptor.pm:855
STACK Bio::DB::BioSQL::PrimarySeqAdaptor::get_unique_key_query
/usr/lib/perl5/site_perl/5.8.5/Bio/DB/BioSQL/PrimarySeqAdaptor.pm:395
STACK Bio::DB::BioSQL::BasePersistenceAdaptor::find_by_unique_key
/usr/lib/perl5/site_perl/5.8.5/Bio/DB/BioSQL/BasePersistenceAdaptor.pm:845
STACK toplevel /home/amit/bin/HCG-blatparser.pl:181



More information about the Bioperl-l mailing list