Commit 2c6905a0 authored by Ian Longden's avatar Ian Longden
Browse files

set port to 5306 if database version >= 48

parent ee4735e4
......@@ -143,7 +143,18 @@ sub new {
$driver ||= 'mysql';
$host ||= 'mysql';
$port ||= 3306;
if(!defined($port)){
$port = 3306;
if($host eq "ensembldb.ensembl.org"){
if( $db =~ /\w_\w_\w_(\d+)/){
if($1 >= 48){
$port = 5306;
}
}
}
}
$wait_timeout ||= 0;
$self->username( $user );
......
......@@ -1101,7 +1101,16 @@ sub load_registry_from_db {
my $compara_version =0;
$user ||= "ensro";
$port ||= 3306;
if(!defined($port)){
$port = 3306;
if($host eq "ensembldb.ensembl.org"){
if( !defined($db_version) or $db_version >= 48){
$port = 5306;
}
}
}
$wait_timeout ||= 0;
my $db = DBI->connect( "DBI:mysql:host=$host;port=$port" , $user, $pass );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment