A question about macports perl and apple perl and versions and locations

Robert Chalmers robert at chalmers.com.au
Mon Dec 14 02:15:31 PST 2015


I came up against a hidden problem this morning. Well, hidden to me up until now anyway. So in case anyone else finds themselves in the same boat - or similar….

I’m running opendmarc here, and the reporting script runs a subroutine called opendmarc-import where in it reads information from a mysql database.

I did a lot of updates yesterday. Added and subtracted things.

opendmarc-import worked fine yesterday, but on a clean restart this morning - it wouldn’t run.

     opendmarc-import: unable to connect to database: Can't connect to local MySQL server through socket '/opt/local/var/run/mysql56/mysqld.sock' (2)

So I had a look at it and noticed immediately that it was looking at /usr/bin/perl on the first line. That’s normally fine. Except in this case it wasn’t.

Because yesterday I archived the existing perl binaries in /usr/bin, and put links to /opt/local/bin/perl*

opendmarc-import barfed on that error - no mysql.sock, because I’mm running a different mysql. Built by Homebrew and I have a LOT of databases in the system, and have been reluctant to make any migration changes. 
robert$ mysql -v
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 166
Server version: 5.6.25 Homebrew


So obviously what happened was this.
The macports perl wanted to talk to macports mysql - and couldn’t. It’s not even running. A different mysql is running. So macports perl5-22 relies on having macports mysql installed in the /opt hierarchy somewhere.  

So my solution for now, was to replace the /usr/bin/perl* links to /opt/local/bin/perl* with the original /usr/bin/perl binaries that I had archived in a directory.

So now I have 
Apple’s perl binaries in /usr/bin again - which so far everything else seems happy with. Version P5.18 as it turns out.
Macport’s perl binaries in /opt/local/bin - which so far nothing seems to know about, except things that look for it specifically, and don’t need mysql. Version P5.22.


mysql
/usr/local/bin/mysql -> ../Cellar/mysql/5.6.25/bin/mysql

I don’t have macports mysql installed.

Also - When Apple updates it’s OS as it does from time to time, then what ever is in /usr/bin will again be overwritten by their own latest version of perl.

So now I have to figure out if it’s worth moving to macports mysql, and how??? so then I can hopefully also switch perl versions….  or just leave well enough alone.
 

Robert Chalmers
robert at chalmers.com <mailto:robert at chalmers.com>.au  Quantum Radio: http://tinyurl.com/lwwddov
Mac mini 6.2 - 2012, Intel Core i7,2.3 GHz, Memory:16 GB. El-Capitan 10.11. 2TB Storage made up of - 
Drive 0:HGST HTS721010A9E630. Upper bay. Drive 1:ST1000LM024 HN-M101MBB. Lower Bay



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-users/attachments/20151214/cd1f01dd/attachment.html>


More information about the macports-users mailing list