[ensembl-dev] Re: Re: Can't connect to ensembl database

Grace Cheng himwo at yahoo.com.hk
Wed Aug 4 18:37:36 BST 2010


I get 42 when I run the code you provided, however, I still can't run my script. 
Any other thing I could test for? 


Thanks,
Grace




________________________________
寄件人﹕ Andy Yates <ayates at ebi.ac.uk>
收件人﹕ Grace Cheng <himwo at yahoo.com.hk>
副本(CC) dev ensembl <dev at ensembl.org>
傳送日期﹕ 2010/8/4 (三) 9:41:14 PM
主題: Re: [ensembl-dev] Re: Can't connect to ensembl database

I would suggest prodding the DBI connection parameters in a separate call. The 
following will connect to EnsemblDB & will also raise an error if it cannot do 
the connection with some error information

use strict;
use warnings;
use DBI;
my $host ='ensembldb.ensembl.org';
my $port = 5306;
my $user = 'anonymous';
my $pass = undef;
my $dbh = DBI->connect( "DBI:mysql:host=$host;port=$port", $user, $pass ) or die 
$DBI::errstr; 

warn $dbh->selectrow_array('select 42');
$dbh->disconnect();

If you get a warning saying 42 then this is fine; if not then post the DBI error 
back to the list.

Andy


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20100805/62de1d6a/attachment.html>


More information about the Dev mailing list