Error in getBM--cannot connect to MySQL
0
0
Entering edit mode
grrompala • 0
@grrompala-14989
Last seen 6.2 years ago

Just trying to use getBM and keep running into this problem (see below). Anyone seen this. Not getting a fix by using host=www.ensembl.org. Let me know if anyone's seen this problem.

 

> library(biomaRt)

> listMarts()
               biomart               version
1 ENSEMBL_MART_ENSEMBL      Ensembl Genes 91
2   ENSEMBL_MART_MOUSE      Mouse strains 91
3     ENSEMBL_MART_SNP  Ensembl Variation 91
4 ENSEMBL_MART_FUNCGEN Ensembl Regulation 91
> snpmart = useMart(biomart = "ENSEMBL_MART_SNP", dataset="hsapiens_snp")
> getBM(attributes = c('refsnp_id','allele','chrom_start','chrom_strand'), 
+       filters = c('chr_name','start','end'), 
+       values = list(8,148350,148612), 
+       mart = snpmart)
Error in getBM(attributes = c("refsnp_id", "allele", "chrom_start", "chrom_strand"),  : 
  Query ERROR: caught BioMart::Exception::Database: Could not connect to mysql database snp_mart_91: DBI connect('database=snp_mart_91;host=127.0.0.1;port=5316','ensro',...) failed: Lost connection to MySQL server at 'reading initial communication packet', system error: 0 at /nfs/public/release/ensweb/latest/live/mart/www_91/biomart-perl/lib/BioMart/Configuration/DBLocation.pm line 98.

biomart • 1.6k views
ADD COMMENT
0
Entering edit mode

Yes, I'm having the exact same issue. Have spent a few hours poking around and seen same issue had been reported over and over again over the years. Seems like the default mysql connection configuration has been constantly evolving. On enseml webpage (https://uswest.ensembl.org/info/docs/api/debug_installation_guide.html), it clearly states that the connection should be established this way:

mysql --host=ensembldb.ensembl.org --port=3306 --user=anonymous

I'm not sure why biomaRt had this hard-coded in the package, or it is just being me not able to figure out how to change it or explicitly call another routine for the mysql query?

ADD REPLY
1
Entering edit mode

biomaRt doesn't use the mysql interface to Ensembl directly, it queries via the RESTful XML interface described here (https://www.ensembl.org/info/data/biomart/biomart_restful.html).  MySQL errors like these typically indicate some instability at the Ensembl end, rather than with the package.

ADD REPLY
0
Entering edit mode

OK, for whatever reason, it has just started working for me. Nothing was changed and everything seems to be fine. Don't know whether it was just because the mysql sever was down.

ADD REPLY
0
Entering edit mode

I had the same problem before but solved it after I re-load my ensembl.

ensembl = useEnsembl(biomart="ensembl", dataset="hsapiens_gene_ensembl")
ADD REPLY

Login before adding your answer.

Traffic: 795 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6