Question: Failed To Connect To The Ensembl Mysql Database
1
gravatar for Fred Fleche
9.5 years ago by
Fred Fleche4.3k
Paris, France
Fred Fleche4.3k wrote:

Hello

I am trying to connect to the mysql database available at ensembl in order to perform some query with the follwoing code but i Get a "Could not connect:" message so I am wondering if I failed because I am not allowed to perform connection out of my network for security reason.

So if someone has the time to test it and to connect successfully I would appreciate.

Thanks in advance.

<?php
$link = mysql_connect('ensembldb.ensembl.org:3306', 'anonymous', '');

if (!$link) {
    die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
mysql ensembl • 3.4k views
ADD COMMENTlink modified 12 months ago by RamRS24k • written 9.5 years ago by Fred Fleche4.3k
2
gravatar for Giovanni M Dall'Olio
9.5 years ago by
London, UK
Giovanni M Dall'Olio26k wrote:

The port is 5306 and not 3306. I had the same problem two years ago and they answered me that:

helpdesk@ensembl.org, on May 22th 2008: From release 48 onwards the Ensembl databases are on port 5306 instead of 3306 of ensembldb …

I asked them if they could update their docs but they didn't do it yet, I don't know why.

ADD COMMENTlink written 9.5 years ago by Giovanni M Dall'Olio26k

Actually it's detailed at http://www.ensembl.org/info/data/mysql.html. The pre-v47 release is on 3306 and anything post is on 5306.

ADD REPLYlink written 9.5 years ago by Ian Simpson930

Actually it's detailed at ensembl.org/info/data/mysql.html The pre-v48 release is on 3306 and anything post is on 5306

ADD REPLYlink written 9.5 years ago by Ian Simpson930

Actually it's detailed at ensembl.org/info/data/mysql.html Version47 and prior releases are on 3306 and anything post is on 5306

ADD REPLYlink written 9.5 years ago by Ian Simpson930
1
gravatar for Ian Simpson
9.5 years ago by
Ian Simpson930
Edinburgh
Ian Simpson930 wrote:

Well this works for me so my guess would be you need to check your firewall settings (both outgoing and incoming http://www.ensembl.org/info/data/mysql.html )

<?php
$link = mysql_connect('ensembldb.ensembl.org:3306', 'anonymous', '');

if (!$link) {
    die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';

$db_list = mysql_list_dbs($link);

while ($row = mysql_fetch_object($db_list)) {
     echo $row-&gt;Database . "\n";
}

mysql_close($link);
?>
ADD COMMENTlink modified 12 months ago by RamRS24k • written 9.5 years ago by Ian Simpson930
2

Also the latest db releases are on port 5306

ADD REPLYlink written 9.5 years ago by Ian Simpson930

If you have a mysql client installed this should work :- mysql -h ensembldb.ensembl.org -P 5306 -u anonymous

ADD REPLYlink written 9.5 years ago by Ian Simpson930
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1523 users visited in the last hour