![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sock::connect error with blast_formatter 2.2.28+ | meetasunil | Bioinformatics | 1 | 07-05-2013 09:40 AM |
DBI and RSQLite Errors plus other Warnings when Installing CummeRbund | jmwhitha | Bioinformatics | 21 | 06-22-2013 08:41 PM |
How to connect shared sequences in two large fasta files | shanshuiii | Bioinformatics | 0 | 03-31-2013 06:28 PM |
Best java lib to connect to ncbi/genebang etc | Tomi | Bioinformatics | 1 | 09-14-2012 07:10 AM |
can NOT connect to www.bioconductor.org | shuang | General | 1 | 03-19-2012 04:55 PM |
![]() |
|
Thread Tools |
![]() |
#21 |
Junior Member
Location: Trento Join Date: Sep 2013
Posts: 7
|
![]()
Thank you, i will check that.
|
![]() |
![]() |
![]() |
#22 |
Senior Member
Location: Vancouver, BC Join Date: Mar 2010
Posts: 275
|
![]()
You can check that at the command line:
Code:
mysql -u orthomcl -P 3307 |
![]() |
![]() |
![]() |
#23 |
Junior Member
Location: Trento Join Date: Sep 2013
Posts: 7
|
![]()
$ cat orthomcl.config
# this config assumes a mysql database named 'orthomcl'. adjust according # to your situation. dbVendor=mysql dbConnectString=dbi:mysql ![]() dbLogin=orthomcl dbPassword=*** (i'm sure it is right) similarSequencesTable=SimilarSequences orthologTable=Ortholog inParalogTable=InParalog coOrthologTable=CoOrtholog interTaxonMatchView=InterTaxonMatch percentMatchCutoff=50 evalueExponentCutoff=-5 oracleIndexTblSpc=NONE and: mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | orthomcl | | test | +--------------------+ 3 rows in set (0.00 sec) So the database exists. I have all the grants for `orthomcl' on this database, and the .config file should be ok... |
![]() |
![]() |
![]() |
#24 |
Senior Member
Location: Vancouver, BC Join Date: Mar 2010
Posts: 275
|
![]()
Try dropping the port from the "dbConnectString" (i.e., try just dbi:mysql
![]() |
![]() |
![]() |
![]() |
#25 |
Junior Member
Location: Trento Join Date: Sep 2013
Posts: 7
|
![]()
YAY! Wait three minutes. I will jump off a bridge and then come back to celebrate this. I think it worked :-)
Thank you! Last edited by amaruquyllur; 09-10-2013 at 09:20 AM. |
![]() |
![]() |
![]() |
#26 |
Junior Member
Location: Trento Join Date: Sep 2013
Posts: 7
|
![]()
USEFUL TIP
(for other users) Actually I had already tried to modify that line, putting port 3306 instead of 3307. Didn't work. But deleted the whole line allowed the connection... THROUGH PORT 3306! A bit crazy, but i have to process some data and not time to ask why. Thanks again. :-) |
![]() |
![]() |
![]() |
#27 | |
Senior Member
Location: Vancouver, BC Join Date: Mar 2010
Posts: 275
|
![]() Quote:
For other users, it may not be necessary to specify the port. However, it is important to correctly specify the host, user, password, and database. If you combine those parameters into a string it may cause parsing/connection issues. |
|
![]() |
![]() |
![]() |
#28 |
Senior Member
Location: East Coast USA Join Date: Feb 2008
Posts: 7,080
|
![]()
Default port for MySQL connections is 3306. Hope you are allowing connects only from localhost (or have appropriate firewall rules set).
|
![]() |
![]() |
![]() |
#29 |
Junior Member
Location: USA Join Date: Aug 2012
Posts: 8
|
![]()
Dear friends,
I encountered similar situation (and this is the closest error message I could find), but could not work it out with the methods discussed here. I would appreciate very much if you can help diagnose and advise some troubleshooting tricks. Please forgive me for this long post as I am a newby for mysql. DESCRIPTION: I installed mysql 5.6.21 to ubuntu 14.04 as a non-root user. I set up the default mysql database using the special configuration file mysql.cnf from the orthoMCL package (socket=/tmp/mysql_2.sock, port=3307, ...): ./scripts/mysql_install_db --defaults-file=mysql.cnf and started mysql server like this: ./bin/mysqld_safe --defaults-file=mysql.cnf & The mysql database seemed running fine. when I typed ps -e|grep -i 'mysqld', I got 23388 pts/0 00:00:00 mysqld_safe 23553 pts/0 00:00:00 mysqld I logged in to this mysql server as root, and created a database called orthomcl that I will use for OrthoMCL. Then I logged out (ctrlD) ./bin/mysql --defaults-file=mysql.cnf -u root -p mysql> CREATE DATABASE orthomcl; mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE VIEW,CREATE, INDEX, DROP on orthomcl.* TO orthomcl@localhost; mysql> set password for orthomcl@localhost = password('yourpassword'); According to the UserGuide, I also created an orthomcl.config file, the first few lines look like this: dbVendor=mysql dbConnectString=dbi:mysql ![]() dbLogin=orthomcl dbPassword=***(I'm sure it's the right password) Then I run the orthomclInstallSchema with the command ./bin/orthomclInstallSchema ./my_orthomcl_dir/orthomcl.config ./my_orthomcl_dir/sql_log_file table_suffix and I got the following error message: DBI connect('orthomcl:localhost:3307','orthomcl',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /home/mylogin/orthomclSoftware-v2.0.9/bin/../lib/perl/OrthoMCLEngine/Main/Base.pm line 56. I assume this may be due to the dbConnectString, so I changed it to dbConnectString=dbi:mysql ![]() and executed the orthomclInstallSchema command again, but I still got the same error: DBI connect('orthomcl','orthomcl',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /home/mylogin/orthomclSoftware....... I even tried dbConnectString=dbi:mysql ![]() DBI connect('orthomcl:3307','orthomcl',...) failed: Can't connect to MySQL server on '3307' (22) at /home/mylogin/orthomclSoftware...... QUESTIONS: 1) As long as the mysql database was running, it is not necessary to login as orthomcl, right? Because the orthomcl.config file will be used to automatically login to the database. 2) What's the difference between these two? Which one should I use? Is the orthomcl a centrally installed mysql server if it was created by root? dbi:mysql ![]() dbi:MySql ![]() 3) I already specified the socket=/tmp/mysql_2.sock in mysql,cnf when I started the mysql server, why was the socket '/var/run/mysqld/mysqld.sock' called later? 4) Did I install the DBI and DBD::mysql modules correctly? I am not sure. I installed them using CPAN as root. $ perl -MCPAN -e shell cpan> o conf makepl_arg "mysql_config=/path_to_mysql_dir/bin/mysql_config" cpan> install Data: ![]() cpan> install DBI cpan> force install DBD::mysql I didn't see error when I check with $ perl -MDBI -e 1 $ perl -MDBD::mysql -e 1 but I received the same DBI error as above when I installed DBD:mysql, such as t/32insert_error.t ................... skipped: ERROR: DBI connect('test','root',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at t/32insert_error.t line 14. Sorry about the long text, hope it helps. |
![]() |
![]() |
![]() |
#30 |
Senior Member
Location: East Coast USA Join Date: Feb 2008
Posts: 7,080
|
![]()
Your problem is related to mysql install.
See these two threads for possible solutions: http://stackoverflow.com/questions/1...un-mysqld-mysq http://www.tech-recipes.com/rx/762/s...-tmpmysqlsock/ |
![]() |
![]() |
![]() |
#31 |
Junior Member
Location: europe Join Date: Jul 2010
Posts: 4
|
![]()
For those who struggle with the error 'DBI connect('orthomcl7','root',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)' while running OrthoMCL, I might have found a simple solution.
When connecting to a MySQL server located on the local system, the mysql client connects through a socket which is typically located in /tmp/mysql.sock. However, the socket can be placed elsewhere, in my case it was /var/run/mysql/mysql.sock. You need to: 1) Find the right location of the socket and replace it in the mysql.cnf e.g. Code:
socket=/var/run/mysqld/mysqld.sock Code:
dbConnectString=dbi:mysql:orthomcl;mysql_socket=/var/run/mysqld/mysqld.sock Last edited by GenoMax; 09-05-2017 at 08:58 AM. |
![]() |
![]() |
![]() |
Tags |
dbi connect, mysql, orthomcl |
Thread Tools | |
|
|