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

Andy Yates ayates at ebi.ac.uk
Wed Aug 4 14:41:14 BST 2010


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



More information about the Dev mailing list