DBD::mysql question

Ryan Schmidt ryandesign at macports.org
Sat Oct 29 17:22:24 PDT 2011


On Oct 29, 2011, at 10:08, Phil Dobbin wrote:

> On 29/10/11 at 14:03, ryandesign at macports.org (Ryan Schmidt) wrote:
> 
>> On Oct 29, 2011, at 05:50, Phil Dobbin wrote:
>> 
>>> Seeing as I’ve rolled my own MySQL what’s the syntax to port install p5.12-dbd-mysql without MySQL? Is it sudo port install p5.12-dbd-mysql -mysql5?
>> 
>> As far as I know, DBD::MySQL requires the MySQL libraries, and MacPorts won't use the MySQL you compiled yourself.
> 
> I just wondered because DBI installed fine from MacPorts. But looking back at the copy of my install of DBD::mysql I had to explicity add flags for perl to find the MySQL libs & includes at compile time (this with perl 5.14 & DBD::mysql in usr/local/) so maybe not...

DBI is the DataBase-Independent module; it doesn't depend on any database engine; DBD are the DataBase-Dependent modules; each of them depend on the libraries for their respective database engines. You write your abstract database-independent perl code to talk to DBI, which then talks to the appropriate DBD module to actually talk to the specific database you're using.

Two questions for you...

1. Why did you compile your MySQL server yourself? Why not use the MacPorts mysql5-server port?

2. Even if you want to continue using your own hand-compiled MySQL server, that's not a problem. p5-dbd-mysql should happily talk to it. In order to do so, it will need its own copies of the MySQL libraries, as installed by the mysql5 port. So just let MacPorts install the mysql5 port for you, even if you don't plan to use it as your server.





More information about the macports-users mailing list