Building DBD::mysql under MacOS X

Friday, December 7th, 2007

MySQL Logo

There’s a glitch when you try to build Perl’s DBD::mysql under MacOS X.

When I tried to build it, I got a lot of errors that looked like this:

t/40numrows............install_driver(mysql) failed: Can't load '/Users/admin/src/CPAN/build/DBD-mysql-4.005-C3W6F2/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/admin/src/CPAN/build/DBD-mysql-4.005-C3W6F2/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib
  Referenced from: /Users/admin/src/CPAN/build/DBD-mysql-4.005-C3W6F2/blib/arch/auto/DBD/mysql/mysql.bundle
  Reason: image not found at /System/Library/Perl/5.8.8/darwin-thread-multi-2level/DynaLoader.pm line 230.

It turns out that DBD::mysql was looking for the dynamic library for MySQL in the wrong place. It invokes mysql_config in order to find the location of the libraries, and mysql_config reports /usr/local/mysql/lib/mysql rather than /usr/local/mysql/lib

The easy way to fix it as to do this is to do this command from a Terminal window:

sudo ln -s /usr/local/mysql/lib/ /usr/local/mysql/lib/mysql

The drawback to this solution is that if you install an update to MySQL, you’ll need to remake this link.

You might also either modify mysql_config (it’s just a script, so it’s easy to edit), or to modify DBD::mysql, but the fix I’ve suggested is the simplest.

The real solution is to fix the MySQL distribution for MacOS X to have the correct path in it.
[tags]dbd::mysql, dbi, perl, mysql, macintosh[/tags]
(more…)

MacOS X 10.5 Leopard, From a Developer’s Perspective

Sunday, November 4th, 2007

Apple’s eagerly awaited operating system, MacOS X 10.5, also known as “Leopard”, is now in our hands, and there are quite a few features in it that will be interesting to developers. Amazon is still offering Leopard for $20 off list and Leopard Family Pack (5-user license) for $10 off list.

I do limited development on MacOS X. I don’t write Macintosh applications, but I do write web-based applications that I deploy to non-Macintosh servers. The Mac is a great environment for doing this; I get a real UNIX environment under the hood with Apache, MySQL and Perl, and a nice layer of Macintosh over the surface. After years of struggling with Windows and Cygwin, or living with Windows and Linux, it’s been wonderful moving to a single, reasonable environment for working.

Given that, my emphasis on development under Leopard will be on the kinds of tools a web developer might use, rather than XCode, although I’ll touch on XCode at the end.

(more…)

MacOS X 10.5 Leopard’s Official Release Date - October 26th

Tuesday, October 16th, 2007

MacOS X 10.5 Leopard box

Apple has finally announced the release date for their new OS, Mac OS X 10.5 Leopard. You can pre-order Leopard at the Apple Store with free shipping and they promise it will arrive on Friday October 26th. You can also pre-order it at Amazon. Amazon is offering a $20 rebate when you order Leopard and Parallels at the same time, and is also currently charging $20 less for Leopard than Apple is. Amazon says they’ll ship Leopard on Friday October 26th.

Check it out at the Apple Store (click here) or at Amazon (click here).
(more…)

vCard Notes

Thursday, May 31st, 2007

vCard is a specification for representing contact information. It’s used to move information between address books in a non-proprietary format, and to download or even upload contact information from web sites.

Apple’s Macintosh Address Book supports vCard as an export and import format as does Microsoft Outlook.

A vCard can contain things like addresses, phone numbers, email addresses, even photographs.

I’m working on a web site which stores contact information for businesses and I want to be able to make that information available to my users in vCard format. So… I’m coding in Perl. There are two Perl packages that look helpful - Net::vCard and Text::vCard. It turns out that Text::vCard is a more recent version of the same codebase as Net::vCard.

Text::vCard provides methods for creating a vCard and setting the data it contains. You can then create an address book using Text::vCard::Addressbook and use its export function to get the actual vCard text.
(more…)

Windows on a Mac in 47 Easy Steps

Thursday, May 24th, 2007

We’re all Mac in-house but when you’re working in the world of software, if you’re doing anything web or World of Warcraft-related, you definitely need to test against Windows occasionally.

On the web side of things, Internet Explorer, while having the largest market share of any web browser, is also the most eccentric of web browsers when it comes to its interpretation of standards. And unfortunately, even the fact that you’re programming in LUA under World of Warcraft doesn’t mean that you won’t encounter problems related to the underlying OS.

For example, Mike has an add-on for World of Warcraft that supports his web site Epic Mount, for WoW guilds. The add-on is working fine under MacOS X but as of this week’s 2.1 update to WoW, is crashing randomly on Windows machines. Not having a Windows machine handy to test it with is a problem.

I used to use Windows all the time, until my Thinkpad caught on fire and Mike’s gentle pestering of “get a mac!” finally won out. I haven’t regretted the switch at all; I have a much better user experience using my Mac, and I have Unix under the hood for the software work I want to do, so no more fidgety hassles trying to get Perl or MySQL to work under Windows. As time goes by, though, my Windows-fu becomes weaker.

We do run Windows under MacOS X on our Intel Macs, via a nifty piece of software called “Parallels Desktop”. Parallels uses the Intel CPU’s native “virtualization” support to trick Windows into thinking it has the machine to itself. There’s very little performance penalty for most operations, but rather than talk directly to the hardware, hardware access has to be emulated. That means that rather than talk to the ethernet card directly, Windows talks to Parallels, which pretends (in software) to be the ethernet card, and makes shared access to the actual ethernet card work. This adds a lot of overhead to hardware accesses. Perhaps the worst issue here is video display card access… Parallels has to pretend (in software again) to be a video card. World of Warcraft has relatively stringent video card requirements; it requires hefty 3D acceleration support to run in even the most minimal mode. Parallels doesn’t yet offer that level of support. Which means, unfortunately, that while the Parallels solution is fine for testing against Internet Explorer under Windows, it won’t help us with testing with World of Warcraft.

(more…)

Prototype Reference Widget

Thursday, February 1st, 2007

prototype.js Dashboard widget

Ajaxian offered up a pointer to a Macintosh Dashboard widget for searching the documentation for the prototype.js documentation.

prototype.js is an excellent Javascript library which provides browser-independent AJAX functionality. It’s at the heart of many AJAX-based applications out there.

(more…)

Create your own widgets with Dashcode - The Unofficial Apple Weblog (TUAW)

Tuesday, January 9th, 2007

Dashcode icon

There are so many kinds of widgets out there now that I can barely keep track. There are Yahoo Widgets (the widgets formerly known as Konfabulator), Apple’s Dashboard, Google Widgets and now Opera has them too. And of course, they’re all different.

My primary interest in widgets from a development perspective is that they can be a good way to help connect people with a web site.

(more…)

Sponsored Links