Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to install Perl DBI & DBD modules correctly?

PLEASE HELP!

I'm running OS X Snow Leopard 10.6.3 on a MacBook Pro.

Using MacPorts I've installed the following items:
mysql5 @5.1.45_0 (active)
mysql5-server @5.1.45_0 (active)
p5-dbd-mysql @4.013_0+mysql5 (active)
p5-dbi @1.609_0 (active)
perl5.10 @5.10.1_1+darwin (active)

Everything seems to be working, with the exception ofthe Perl DBI module, and the DBD module. Whenever I try to run a Perl program using DBI, I get the following error:

Sun Apr 18 03:18:42 EDT 2010
~/Perl1 ->
peterv@MBP17.local<520>$: db.pl
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: /Library/Perl/Updates/5.10.0 /System/Library/Perl/5.10.0/darwin-thread-multi-2level /System/Library/Perl/5.10.0 /Library/Perl/5.10.0/darwin-thread-multi-2level /Library/Perl/5.10.0 /Network/Library/Perl/5.10.0/darwin-thread-multi-2level /Network/Library/Perl/5.10.0 /Network/Library/Perl /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level /System/Library/Perl/Extras/5.10.0 .) at (eval 3) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, Proxy, SQLite, Sponge.
at /Users/peterv/Perl1/db.pl line 8

Sun Apr 18 03:18:42 EDT 2010



If anyone can also explain what @INC is (I'm assuming it's some kind of path), how to display its value, and how to set it correctly, I'd appreciate that too! I've been working on this for days, so I'd really be grateful for some help!
Thanks,
Peter V.

MacBook Pro 17", Mac OS X (10.6.3)

Posted on Apr 18, 2010 1:14 AM

Reply
2 replies

Apr 18, 2010 1:49 AM in response to peterv6

I've found the problem. I didn't realize that OS X Snow Leopard came with 2 versions of Perl installed, so when I wanted to upgrade to 5.10, I installed it using MacPorts. I also hadn't realized that MacPorts paths had /opt/local prepended to them, so I was running the wrong version of Perl with it. Now I don't get the original error message I posted, but I do get these error messages:

dyld: lazy symbol binding failed: Symbol not found: mysqlinit
Referenced from: /opt/local/lib/perl5/site_perl/5.10.1/darwin-multi-2level/auto/DBD/mysql/mysql. bundle
Expected in: dynamic lookup

dyld: Symbol not found: mysqlinit
Referenced from: /opt/local/lib/perl5/site_perl/5.10.1/darwin-multi-2level/auto/DBD/mysql/mysql. bundle
Expected in: dynamic lookup

Trace/BPT trap

Can someone help me out with these?
Thanks in advance!

How to install Perl DBI & DBD modules correctly?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.