Failed To Connect To The Ensembl Mysql Database
2
1
Entering edit mode
11.8 years ago

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 • 4.3k views
ADD COMMENT
2
Entering edit mode
11.8 years ago

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 COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
1
Entering edit mode
11.8 years ago
Ian Simpson ▴ 960

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 COMMENT
2
Entering edit mode

Also the latest db releases are on port 5306

ADD REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 2132 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