MAMP 1.7 and DBD::mysql

This is a brief post on how to get Perl’s DBD::mysql working with MAMP 1.7 on Mac OS X Leopard. The instructions for now, are quite concise.

I have found that using CPAN does not seem to work to install DBD::mysql when you only have MAMP installed. The CPAN commands:

perl -MCPAN -eshell
install DBD::mysql

This I think is due to MAMP not having the correct MySQL files or libraries installed. Below are the steps required to get DBD::mysql working.

Note: You will probably need XCode tools installed to be able to compile the MySQL libraries.

1. Install the header files

Download the full MAMP packages.

The file that you need is called something like MAMP_1.7_intel_full.dmg.

This image contains the required files. Copy:

cp -r /Volumes/MAMP/MAMP/Library/include /Applications/MAMP/Library

2. Install the MySQL client libraries

  1. Download the MAMP sources. MAMP_1.7_src.tar.gz
  2. Untar
  3. Untar the mysql archive file
  4. Change directory to the mysql directory
  5. Configure and build mysql
    ./configure --with-unix-socket-path=/Applications/MAMP/tmp/mysql/mysql.sock \
        --without-server \
        --prefix=/Applications/MAMP/Library
    make -j2
    
  6. Copy libraries
    cp libmysql/.libs/*.dylib /Applications/MAMP/Library/lib/mysql
    

3. Build and install DBD::mysql

  1. Download DBD-mysql-4.006.tar.gz or similar from CPAN. (Or use the one in ~/.cpan/build/DBD-mysql-4.006)
  2. Build
    perl Makefile.PL --CFLAGS="-I/Applications/MAMP/Library/include/mysql -Os -arch i386 -fno-common" \
        --libs="-L/Applications/MAMP/Library/lib/mysql -lmysqlclient -lz -lm" \
        --mysql_config="/Applications/MAMP/Library/bin/mysql_config"
    make
    make test
    sudo make install
    

Make test may throws errors about connecting to the database server but should not throw an errors about using shared libraries or missing symbols.

My Travel Map

Languages

I found this on /.

  • APL ~= Car built out of Legos. Fully operational. No one knows how it works. Or why.
  • ASM ~= Suzuki Hayabusa: Ready, aim, goodbye
  • C ~= Ferrari - drive it wrong and you’ll be wrapped round a tree before you know it
  • C++ ~= Pickup truck w/extended cab, dually axles, 4wd
  • COBOL ~= Loaner. No one would buy one, after all
  • Fortran ~= 1980’s generic sedan. Speedo only goes to 80. But it has a lot of controls and gauges
  • Haskell ~= Kit car. Not assembled. No directions. Not street legal.
  • Java ~= VW bug complete w/flower stickers, rabid activists, and parking permit for trendy coffee shop
  • Lisp ~= Mexican hopping car - scares the hell out of anyone who encounters it
  • Pascal ~= Delorean DMC-12. Beautifully conceived; decently built; underpowered.
  • Perl ~= Heavily modified Sachsenring Trabant P50 w/snow tires and chains. Only the owner can drive it, but it’ll go anywhere. And then break down. Only the owner can fix it. But he can fix anything that happens.
  • Python ~= Corvette w/luxury options, hatch full of cool accessories.
  • Rexx ~= Modular 4-cylinder engine; plugs into anything. Every time you do, though, you need a new manual
  • Ruby ~= Camaro - trying like hell to be a Corvette, still not stable or fast enough
  • SQL ~= Coke truck - it’ll carry anything, as long as it fits in a coke sized slot
  • VB ~= Poorly designed bicycle with two flat tires and no pump.
  • VHDL ~= Huge box of legos. Only you can make it run. But you can make anything.

V3i Driver for Windows XP

Help my V3i is going flat and I’m at a friends house who have a PC and a mini-usb cable. Where do I get the V3i drivers from for Windows XP?

Now that’s a question I found myself asking a few weeks ago. The usual search on google provided no useful results.

Motorola’s USB Drivers or try Alternate V3i Driver for Windows XP

*updated links 10 April 1007*

Vmware on Debian 4.0 (Etch) Kernel 2.6.18-3

Having problems compiling the vmmon kernel module on Debian 4.0 (Etch) using the 2.6.18-3 kernel?

Getting an error like:

The directory of kernel headers (version @@VMWARE@@ UTS_RELEASE) does not match
your running kernel (version 2.6.18-3-amd64). Even if the module were to
compile successfully, it would not load into the running kernel.
To fix this you need to copy the UTS_RELEASE information into the version.h file.

Copy the line (or similar):

#define UTS_RELEASE "2.6.18-3-amd64"

from /usr/src/linux-headers-2.6.18-3-amd64/include/linux/utsrelease.h /usr/src/linux-headers-2.6.18-3-amd64/include/linux/version.h

The vmmon module will then compile successfully.