bp_seqfeature_load.pl module cannot connect to mysql

Ryan Schmidt ryandesign at macports.org
Wed Oct 6 14:04:54 PDT 2010


On Oct 6, 2010, at 15:49, Rodolfo Aramayo wrote:

> Background:
> Perl was installed via Macports.
> Bioperl was installed via CPAN and seems to be installed in a MacPorts directory.

I realize I have not yet committed the p5-bioperl port that was submitted, so you didn't really have a choice, but using CPAN to install into a MacPorts-owned directory can be problematic. For example, once I do commit p5-bioperl, if you try to install it, MacPorts will complain that the files it wants to install are already there and it doesn't know where they came from.


> I installed p5-dbd-mysql via ports
> My server is running Apple MySQL so even though MySQL was installed as a dependency of p5-dbd-mysql, it is not being used because I do not know how to activate the ports one...(see below)
> 
> 
> Problem:
> Trying to load a database we rtun into the following
> bp_seqfeature_load.pl -c -u "username" -p "password" -a DBI::mysql -d database data.fasta data.gff
> 
> we run into the following error:
>  ====
> DBI connect('Ncrassa_scaffold','rsw3284',...) failed: Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (2) at /opt/local/lib/perl5/site_perl/5.12.1/Bio/DB/SeqFeature/Store/DBI/mysql.pm line 217
> 
> -------------------- EXCEPTION --------------------
> MSG: Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (2)
> STACK Bio::DB::SeqFeature::Store::DBI::mysql::init /opt/local/lib/perl5/site_perl/5.12.1/Bio/DB/SeqFeature/Store/DBI/mysql.pm:217
> STACK Bio::DB::SeqFeature::Store::new /opt/local/lib/perl5/site_perl/5.12.1/Bio/DB/SeqFeature/Store.pm:386
> STACK toplevel /opt/local/bin/bp_seqfeature_load.pl:101
> ====
> 
> MySQL appears to be trying to use '/opt/local/var/run/mysql5/mysqld.sock' which does not exist.
> 
> Solution: I solved this problem by going to directory:
> 
> /opt/local/var/run/
> 
> which exists and there I created a directory called mysql5
> >mkdir -pv mysql5
> >cd mysql5
> And a link to the MySQL socket present in /var/mysql
> 
> >sudo ln -s /var/mysql/mysql.sock mysqld.sock
> 
> and that solved the problem
> 
> I believe this is a bug? that might need to be fixed?

What do you believe the bug is; what should be changed? If the MySQL daemon's socket is not at the usual MacPorts location of /opt/local/var/run/mysql5/mysqld.sock but somewhere else, you need to inform your MySQL client where that is. I believe that's done by editing the my.cnf file.


> Regardless, this way I am running p5-dbd-mysql with Apple mysql which it might not be optimal but allowed me to have the computer ready for class

Apple MySQL... so you are running Mac OS X Server? Apple does not include MySQL in the consumer version of Mac OS X.


> So how do I switch to the ports MySQL?

Instructions for using MacPorts MySQL are included in the MAMP how-to document:

http://trac.macports.org/wiki/howto/MAMP#mysql




More information about the macports-users mailing list