This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Querry Error - Can't connect to MySQL server on '127.0.0.1' (111)

Hi all,

I'm trying to run this code:

annot <- getBM(   filters    = "ensembl_gene_id",   attributes = c("ensembl_gene_id",
                 "description",
                 "gene_biotype",
                 "hgnc_id",
                 "hgnc_symbol",
                 "entrezgene_id"),   values     = rownames(LengthScaledTPM),   mart       = mart )

And receive the error message Query ERROR: caught BioMart::Exception::Database: Could not connect to mysql database ensembl_mart_115: DBI connect('database=ensembl_mart_115;host=127.0.0.1;port=5316','ensro',...) failed: Can't connect to MySQL server on '127.0.0.1' (111) at /nfs/public/ro/ensweb/live/mart/www_115/biomart-perl/lib/BioMart/Configuration/DBLocation.pm line 98.

I asked Claude AI and it says "the internal MySQL instance for mart 115 is down on their end". Although it suggests me some alternative ways, I don't think I'm savvy enough to use them and troubleshoot later if my data turns out weird (I'm a beginner). I also wait 24 hours to re-run and it's still the same.

Any advice for me?

Thank you!

annotation biomart error

I also wait 24 hours to re-run and it's still the same.

Unfortunately Ensembl site (and associated services) have become less reliable as they work on transitioning to new versions of the server (accessible in beta here https://beta.ensembl.org/ ).

Not sure which MySQL server you are using but you can try other servers mentioned here: https://www.ensembl.org/info/data/mysql.html?redirect=no

Otherwise use the web interface for BioMart to get what you need: https://www.ensembl.org/index.html?redirect=no

hi if I am right, I think I used biomart. the code before the above code I used was

mart <- useEnsembl("hsapiens_gene_ensembl", 
                   useMart("ensembl"))

is this biomart that you mention?

Just to confirm. You are using the R bioMaRt package and seeing this error?

Try the following to make sure that you are connecting to the main Ensembl server.

# Example: Connecting to main server
ensembl <- useMart(biomart = "ENSEMBL_MART_ENSEMBL", 
                   host = "https://www.ensembl.org",
                   dataset = "hsapiens_gene_ensembl")

yeah it is biomaRt. so I retried these codes again

mart <- useMart(biomart = "ENSEMBL_MART_ENSEMBL", 
                   host = "https://www.ensembl.org",
                   dataset = "hsapiens_gene_ensembl")

annot <- biomaRt::getBM(filters = "ensembl_gene_id", 
                        attributes = c("ensembl_gene_id",
                                       "description",
                                       "gene_biotype",
                                       "hgnc_id",
                                       "hgnc_symbol",
                                       "entrezgene_id"),
                        values = rownames(LengthScaledTPM), 
                        mart = mart)

The console shows promising Batch submitting query [===========>---------] 50% eta: 2m and then the error shows up again

Error in .processResults(postRes, mart = mart, hostURLsep = sep, fullXmlQuery = fullXmlQuery,  : 
  Query ERROR: caught BioMart::Exception::Database: Could not connect to mysql database ensembl_mart_115: DBI connect('database=ensembl_mart_115;host=127.0.0.1;port=5316','ensro',...) failed: Can't connect to MySQL server on '127.0.0.1' (111) at /nfs/public/ro/ensweb/live/mart/www_115/biomart-perl/lib/BioMart/Configuration/DBLocation.pm line 98.

You can put a ticket in with Ensembl and let them know about this error.

Alternatively use the bioMaRt web interface to get the information about genes (I suppose values above contains the list of genes you are interested in?). (https://www.ensembl.org/index.html?redirect=no click on bioMart link).

Hi yes, I asked Ensembl to check. This morning they said the error was fixed but it didn't work out LOL

I have about 78,000 rows of gene IDs (yes the values are list of genes). Do you know which tutorial I can use bioMart website to look up?

1 answer

I have also run into this error but have been able to get around it by using an archived biomart host. This one seems to usually work, not sure if any later ones are working too.

biomarthost = "https://feb2021.archive.ensembl.org/"
useMart("ensembl", dataset = "hsapiens_gene_ensembl", host = biomarthost)

Log in to answer this question.