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.
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);
?>
2 answers
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.
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->Database . "\n";
}
mysql_close($link);
?>
Log in to answer this question.