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

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


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:

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'@'' (using password: NO)
STACK Bio::DB::DBI::base::new_connection
STACK Bio::DB::DBI::base::get_connection
STACK Bio::DB::BioSQL::BasePersistenceAdaptor::dbh
STACK Bio::DB::BioSQL::BaseDriver::prepare_findbyuk_sth
STACK Bio::DB::BioSQL::BasePersistenceAdaptor::_find_by_unique_key
STACK Bio::DB::BioSQL::BasePersistenceAdaptor::find_by_unique_key
STACK Bio::DB::BioSQL::PrimarySeqAdaptor::get_unique_key_query
STACK Bio::DB::BioSQL::BasePersistenceAdaptor::find_by_unique_key
STACK toplevel /home/amit/bin/HCG-blatparser.pl:181

More information about the Bioperl-l mailing list