<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Stephen,<div><br></div><div>Thank you for your reply.</div><div>With your example, I encounter another error (copy-pasted here):</div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">Could not connect to database XXXX as user XXXX using [DBI:mysql:database=XXXXX;host=XXXX;port=5306]<u> as a locator</u>:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">DBI connect(‘database=XXXX;host=genobdd;port=5306’,'XXXX',...) failed: Can't connect to MySQL server on ‘XXXX' (111) at src/ensembl/modules/Bio/EnsEMBL/DBSQL/DBConnection.pm line 263.</div></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><div style="margin: 0px;"><br></div><div style="margin: 0px;">-------------------- EXCEPTION --------------------</div><div style="margin: 0px;">MSG: Could not connect to database GENOCOMP as user XXXXX using [DBI:mysql:database=XXXXX;host=XXXX;port=5306] as a locator:</div><div style="margin: 0px;">DBI connect(‘database=XXX;host=genobdd;port=5306’,'XXXXX',...) failed: Can't connect to MySQL server on ‘xxxxx' (111) at /home/genouest/umr6061/recomgen/tderrien/src/ensembl/modules/Bio/EnsEMBL/DBSQL/DBConnection.pm line 263.</div><div style="margin: 0px; min-height: 13px;"><br></div><div style="margin: 0px;">STACK Bio::EnsEMBL::DBSQL::DBConnection::connect /home/genouest/umr6061/recomgen/tderrien/src/ensembl/modules/Bio/EnsEMBL/DBSQL/DBConnection.pm:279</div><div style="margin: 0px;">STACK Bio::EnsEMBL::DBSQL::DBConnection::db_handle /home/genouest/umr6061/recomgen/tderrien/src/ensembl/modules/Bio/EnsEMBL/DBSQL/DBConnection.pm:676</div><div style="margin: 0px;">STACK Bio::EnsEMBL::DBSQL::DBConnection::prepare /home/genouest/umr6061/recomgen/tderrien/src/ensembl/modules/Bio/EnsEMBL/DBSQL/DBConnection.pm:707</div><div style="margin: 0px;">STACK Bio::EnsEMBL::DBSQL::BaseAdaptor::prepare /home/genouest/umr6061/recomgen/tderrien/src/ensembl/modules/Bio/EnsEMBL/DBSQL/BaseAdaptor.pm:176</div><div style="margin: 0px;">STACK Bio::EnsEMBL::DBSQL::BaseMetaContainer::list_value_by_key /home/genouest/umr6061/recomgen/tderrien/src/ensembl/modules/Bio/EnsEMBL/DBSQL/BaseMetaContainer.pm:121</div><div style="margin: 0px;">STACK Bio::EnsEMBL::DBSQL::BaseMetaContainer::get_schema_version /home/genouest/umr6061/recomgen/tderrien/src/ensembl/modules/Bio/EnsEMBL/DBSQL/BaseMetaContainer.pm:77</div><div style="margin: 0px;">STACK Bio::EnsEMBL::Registry::version_check /home/genouest/umr6061/recomgen/tderrien/src/ensembl/modules/Bio/EnsEMBL/Registry.pm:2675</div><div style="margin: 0px;">STACK Bio::EnsEMBL::Registry::get_adaptor /home/genouest/umr6061/recomgen/tderrien/src/ensembl/modules/Bio/EnsEMBL/Registry.pm:1050</div><div style="margin: 0px;">STACK toplevel connect.pl:7</div><div style="margin: 0px;">Date (localtime)    = Fri Jul 18 14:27:14 2014</div><div style="margin: 0px;">Ensembl API version = 75</div></div><div style="margin: 0px;"><br></div><div style="margin: 0px;"><br></div><div style="margin: 0px;">For information, a "normal" connection with "<span style="font-family: Menlo; font-size: 11px;">mysql -u XXX -h XXXX -D XXXX -p" </span>works well.</div><div><br></div><div>Thank you for your help.</div><div><br></div><div>Cheers,</div><div><br></div><div>Thomas</div><div><br></div><div style=""><div>Le 18 juil. 2014 à 12:23, Stephen Fitzgerald <<a href="mailto:stephenf@ebi.ac.uk">stephenf@ebi.ac.uk</a>> a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi Thomas, try using this "reg_conf.pl" file in the same directory as your script:<br><br><blockquote type="cite">cat reg_conf.pl<br></blockquote><br>###<br>use strict;<br>use Bio::EnsEMBL::Utils::ConfigRegistry;<br>use Bio::EnsEMBL::DBSQL::DBAdaptor;<br>use Bio::EnsEMBL::Compara::DBSQL::DBAdaptor;<br>use Bio::EnsEMBL::Registry;<br><br>my @aliases;<br><br><br>new Bio::EnsEMBL::Compara::DBSQL::DBAdaptor(<br>        -host => 'xxxx',<br>        -user => 'xxxx',<br>        -port => 5306,<br>        -pass => 'xxxx',<br>        -species => 'Multi',<br>        -group => 'compara',<br>        -dbname => 'xxxx');<br><br>1;<br><br><br><br>and call it explicitly in your script.<br><br>###<br>use strict;<br>use warnings;<br>use Data::Dumper;<br>use Bio::EnsEMBL::Registry;<br><br>Bio::EnsEMBL::Registry->load_all("reg_conf.pl");<br>my $member_adaptor = Bio::EnsEMBL::Registry->get_adaptor('Multi', 'compara', 'GeneMember');<br>print Dumper $member_adaptor;<br>###<br><br>See if this works.<br><br>Cheers,<br>Stephen.<br><br><br><br><br>On Fri, 18 Jul 2014, Thomas Derrien wrote:<br><br><blockquote type="cite">Dear all,<br>I have installed a local version of the compara database named GENOCOMP (without the core(s) databases).<br>Then, I would like to use the perl API to query it.<br>Here is the simple script I used with the ensembl.init file at the end of the email.<br>###############<br>use strict;<br>use warnings;<br>use Data::Dumper;<br>use Bio::EnsEMBL::Registry;<br>Bio::EnsEMBL::Registry->load_all();<br>my $member_adaptor = Bio::EnsEMBL::Registry->get_adaptor('Compara', 'compara', 'GeneMember');<br>print Dumper $member_adaptor;<br>#################<br>This scripts returns the following error:<br>------------------- WARNING ----------------------<br>MSG: Compara is not a valid species name (check DB and API version)<br>FILE: Bio/EnsEMBL/Registry.pm LINE: 1198<br>CALLED BY: Bio/EnsEMBL/Registry.pm  LINE: 983<br>Date (localtime)    = Fri Jul 18 11:04:36 2014<br>Ensembl API version = 75<br>---------------------------------------------------<br>-------------------- EXCEPTION --------------------<br>MSG: Can not find internal name for species 'Compara'<br>STACK Bio::EnsEMBL::Registry::get_adaptor /home/genouest/umr6061/recomgen/tderrien/src/ensembl/modules/Bio/EnsEMBL/Registry.pm:985<br>STACK toplevel getOrthologAPI_genocomp.pl:65<br>Date (localtime)    = Fri Jul 18 11:04:36 2014<br>Ensembl API version = 75<br>---------------------------------------------------<br>I also tried with:<br>my $member_adaptor = Bio::EnsEMBL::Registry->get_adaptor(‘Multi', 'compara', 'GeneMember');<br>without any success.<br>Any help would be much appreciated.<br>Thanks in advance<br>Thomas<br>PS: My ensembl.init file<br>$ cat ~/.ensembl_init <br>use strict;<br>use Bio::EnsEMBL::Utils::ConfigRegistry;<br>use Bio::EnsEMBL::DBSQL::DBAdaptor;<br>use Bio::EnsEMBL::Compara::DBSQL::DBAdaptor;<br>my $host   = 'genobdd';<br>my $user   = 'GENOCOMP';<br>my $port   = 5306;<br>my $dbname = 'GENOCOMP';<br>my $pass = ‘XXXXXXXXX';<br>new Bio::EnsEMBL::Compara::DBSQL::DBAdaptor(<br>  -host    => $host,<br>  -user    => $user,<br>  -pass   => $pass,<br>  -port    => $port,<br>  -dbname  => $dbname,<br>  -verbose => 1<br>);<br>1;<br></blockquote>_______________________________________________<br>Dev mailing list    <a href="mailto:Dev@ensembl.org">Dev@ensembl.org</a><br>Posting guidelines and subscribe/unsubscribe info: <a href="http://lists.ensembl.org/mailman/listinfo/dev">http://lists.ensembl.org/mailman/listinfo/dev</a><br>Ensembl Blog: <a href="http://www.ensembl.info/">http://www.ensembl.info/</a><br></blockquote></div><br></body></html>