For Flycub.

It wasn't too long ago I installed MAMP on my Macbook. Everything worked as advertised - straight out of installation. I popped Joomla!, Expression Engine and WordPress in and they all ran like happy little puppies.

Installing MovableType required me to install DBI in order to have MAMP parse Perl.

Good thing I found Nargalzius' post. His step by step instructions helped a ton. The DBI module was installed.

The DBD::MySQL module, on the other hand, was a royal pain in the behind.

For starters, Nagalzius' post was written more than a year ago and MAMP seems to have evolved quite a bit since then.

There are 3 variables when you hit the sudo perl MakeFile.PL command.

  • mysql_config
  • cflags
  • libs

All of which were problems that needed to be solved.

mysql_config was no longer found in the directory Nagalzius specified. Rather than /Applications/MAMP/bin/mysql4/bin/mysql_config, it was located at /Applications/MAMP/bin/Library/bin/mysql_config.

Like Jay Allen noted, the cflag path obtained from mysql_config pointed to a non-existent directory. Having absolutely no idea what it was supposed to point to, I threw every sql-esque directory at it, hoping some would stick. After hours of jostling and surfing for solutions, I realised that the cflags paramater was meant to point to a directory named "include" containing MySQL header files.

Jay Allen's observation also confirmed my initial thoughts that the message

Note (probably harmless): No library found for -lmysqlclient

I got when running the first MakeFile command wasn't really harmless. The library directory, while correct, did not have the library files necessary to install DBD::MySQL.

I downloaded MySQL 5, unpacked it and rummaged for the files I needed. I transfered the entire "include" directory into /Applications/MAMP/Library/ and copied all the files in the /lib/ directory into /Applications/MAMP/Library/lib/mysql/. I ran the make command and the make install command, and finally the MT-check.cgi to see if everything worked.

Sweet.

Summary

  1. Find your mysql_config. For me, the path was /Applications/MAMP/Library/bin/mysql_config
  2. sudo Perl MakeFile.PL --mysql_config=/Applications/MAMP/Library/bin/mysql_config
  3. Download MySQL 5. Unpack the files.
  4. Look in the MySQL files you just downloaded and move the directory include to /Applications/MAMP/Library/
  5. Go to the lib directory in the MySQL files you just downloaded. Cut and paste all the files into /Applications/MAMP/Library/lib/mysql/
  6. sudo make
  7. sudo make install
  8. Run mt-check.cgi to see if it's all there

Afterword

Installing MovableType didn't work as smoothly as I thought.

Add DBSocket /Applications/MAMP/tmp/mysql/mysql.sock to mt-config.cgi to point Movabletype to the place where your mysql.sock is located.

0 Trackbacks

Listed below are links to blogs that reference this entry: Movabletype on MAMP.

TrackBack URL for this entry: http://tribolum.com/cgi-bin/mt/mt-tb.cgi/2083

8 Comments

I KNOW I read all the words on this blog, but for some reason I only understood 3/4 of it.

I take that back, I dont understand it at all.

Hi Audrey!

Sorry the post got rather technical. Just wanted to document down a problem I solved. :)

Oh I knew that, I thought it was really funny I read all the words but didnt understand a thing. How’s things? I see Anne is growing up pretty fast!

Great post! I was having the same problems and then stumbled across the post you referred to:

http://www.nargalzius.com/blog/archives/2005/09/20050916_2327PM.php

But then ran into the other problems you experienced. Following your guides I was eventually able to figure it all out and get it working. Your article probably saved me an extra day or two or trying to figure out what was wrong with the installation.

Definitely a good idea to write it down as a reference, I’ll be bookmarking this page so don’t take it down :)

This article seems to have become a key reference for anyone installing MT on MAMP. For me, it’s had the most success, but ultimately fails.

I’ve been working several days to get MT4 to install on OS X 10.4.10. On day 1, I wasn’t using MAMP and struggled with DBI and DBD::mysql. DBD::mysql seemed to be working but MT wouldn’t recognize it.

On day 2, I tried MAMP 1.7 and followed this tutorial, which went really well. mt-check.cgi was thrilled that everything was perfect. But CocoaMySQL couldn’t connect to the database until I amended my bash profile (link below: Switch). With that fixed, I tried mt-wizard.cgi which still couldn’t connect to the database. Manually configuring the connection using mt-config.cgi and specifiying the DBsocket failed as well.

MAMP’s Apache log says this: dyld: Symbol not found: mysqlserver_init Referenced from: /Library/Perl/5.8.6/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle Expected in: dynamic lookup Premature end of script headers: mt.cgi

I googled that to find a bunch of articles I can’t understand by developers. I’ve installed MT repeatedly, triple checked permissions, tweaked and tested every possible option in mt-config.cgi, tried downgrading the MySQL include and lib files from 5 to 4 - mt-check is always happy, and mt-wizard can never connect to the DB and mt.cgi always fails. I’m as amazed your installation worked as I am that after more than 2 days, mine doesn’t. Last night at 2am I decided to install Wordpress on MAMP to make me feel better. It was a 4 minute comedy of simplicity. (I know, but still.)

I give up. For my next trick, I”m going to melt plastic cutlery with my mind.

Mac OS X 10.4.10 Movable Type 4.01 MAMP 1.7 DBI-1.59 DBD-mysql-4.005 mysql-5.0.45 Perl 5.8.6

Switch: web nerddom - Perl vs MAMP/MySQL/Mac OS X http://www.jaanuskase.com/en/2006/12/switchwebnerddom.html

Unless there is a good reason not to, I’d recommend trying SQLite instead of MySQL. I got success in half an hour after days of failure with MySQL. There are just too many complications installing MT/MySQL on Tiger. I’d avoided SQLite due to unfamiliarity. That was a mistake.

Anyway, I used the following page from MacZealots as a reference: http://maczealots.com/tutorials/movabletype/

Thanks Brad. I haven’t had time to try SQLite, but if there’s an easier way to get MT to work on MAMP, it’ll save us all a ton of time.

Leave a comment


Type the characters you see in the picture above.