Archive Ensembl HomeArchive Ensembl Home
Home > Help & Documentation

The Ensembl public MySQL Servers

For large amounts of data and more detailed analysis, we recommend you use our publicly-accessible MySQL server, ensembldb.ensembl.org, which you can access as user 'anonymous'. A second server, martdb.ensembl.org provides public access to the BioMart databases.

There are two options for retrieving data from the Ensembl databases:

Perl API
The easiest option is to use the Ensembl Perl API. The API uses an object-oriented approach to model real biological objects such as genes, transcripts and 'slices' of DNA sequence, making it straightforward for you to write scripts that retrieve and analyze data.
# find gene stable ids corresponding to the MGI symbol 'Tyr'
my $gene_adaptor = $dbCore->get_GeneAdaptor();
my @genes = @{ $gene_adaptor->fetch_all_by_external_name('Tyr') };

Additional code examples and suggestions can be found in the various API tutorials and the ensembl-dev mailing list archives.

MySQL client
Alternatively, you can use a MySQL client program to query the database directly. However this does require knowledge of the complex database schemas used by Ensembl, so we only recommend it if you are unable to install our API (e.g. if you have no access to Perl). Also note that direct MySQL queries on the database are not suited to retrieve sequences. To retrieve sequences please use the Perl API.

For BioMart access, we strongly recommend that you use the martview web interface, as the mart databases contain very many tables of denormalised data. Data can also be retrieved from BioMart programmatically, using the Mart XML-based webservice.

Summary of servers and ports

Important note: Because we are serving databases on both MySQL4 and MySQL5, not all MySQL instances use the default port; please ensure that you specify the correct port when trying to connect. In addition, if your computer is behind a firewall, outgoing TCP/IP connections to the corresponding ports need to be allowed, too. Otherwise connections will not be established.

ServerUp to version 47Version 48 onwards
ensembldb.ensembl.org33065306
martdb.ensembl.org33165316