[ensembl-dev] problem connecting to ensembl directly with DBConnector
Andrea Edwards
edwardsa at cs.man.ac.uk
Thu Dec 30 16:50:49 GMT 2010
Hello
What should the database name be for this code to work on the ensembl
human core/variation and cow core/variation databases?
This code works fine when it run it against local installations but says
dbname does not exist when i run against ensembl server. I looked up
most recent database name from ftp site.
$dbc = Bio::EnsEMBL::DBSQL::DBConnection->new( -user =>
'anonymous', -dbname => 'homo_sapiens_variation_60_37e', -host
=> 'ensembldb.ensembl.org', -driver => 'mysql', );
# SQL statements should be created/executed through this modules
# prepare() and do() methods.
$sql = "select allele_id from allele limit 100";
$sth = $dbc->prepare($sql);
Could not connect to database homo_sapiens_variation_60_37e as user
anonymous using
[DBI:mysql:database=homo_sapiens_variation_60_37e;host=ensembldb.ensembl.org;port=3306]
as a locator:
Unknown database 'homo_sapiens_variation_60_37e' at
C:\Perl\site\lib\ensembl-api\ensembl\modules/Bio/EnsEMBL/DBSQL/DBConnection.pm
line 290.
-------------------- EXCEPTION --------------------
MSG: Could not connect to database homo_sapiens_variation_60_37e as user
anonymous using
[DBI:mysql:database=homo_sapiens_variation_60_37e;host=ensembldb.ensembl.org;port=3306]
as a locator:
Unknown database 'homo_sapiens_variation_60_37e'
STACK Bio::EnsEMBL::DBSQL::DBConnection::connect
C:\Perl\site\lib\ensembl-api\ensembl\modules/Bio/EnsEMBL/DBSQL/DBConnection.pm:299
STACK Bio::EnsEMBL::DBSQL::DBConnection::db_handle
C:\Perl\site\lib\ensembl-api\ensembl\modules/Bio/EnsEMBL/DBSQL/DBConnection.pm:618
STACK Bio::EnsEMBL::DBSQL::DBConnection::prepare
C:\Perl\site\lib\ensembl-api\ensembl\modules/Bio/EnsEMBL/DBSQL/DBConnection.pm:647
STACK toplevel C:/Documents and
Settings/Administrator/Desktop/PHD/java/Code/ensembl
database/variation.pl:23
Are there any other ways to issue SQL queries directly?
Many thanks
More information about the Dev
mailing list