« For Sale: A MacBook Box? | Main | New and Updated Knowledge Base Documents »

How to Upgrade DBD::MySQL for MacOSX 10.4.7 (Universal)

So I decided to upgrade DBD::MySQL to the latest version, 3.0008 as of this writing. So imagine my surprise when the install didn't work even after following my own instructions here on MacNewsBlog.com!

Well after a few minutes of panic, fearing I had broken my working Movable Type system, I calmed down, realized that I had a backup of the system (please remember to backup everything before doing any sort of updates! I use SuperDuper religiously!) and proceeded to troubleshoot it all.

I had to concentrate on this one because it's kinda complicated... but after a few minutes I figured it out. DBD::MySQL does a series of tests against a database called test when you run MakeFile.pl. I had forgotten that I dumped the test database after installing MySQL5 and running mysql_secure_installation. So all I had to do was create a new test database for DBD::MySQL to run its tests against and give MakeFile.pl the right flags.

Step by Step:
Make your database in MySQL. I usually do the following via the terminal:

mysql -u root -p
then enter your password

type the following commands:

create database blog;
grant all on blog.* to username@localhost identified by “password”;

change username@localhost to whatever your mysql username will be and change password to your password. Then type:
quit

then all you have to do is download the new DBD::Mysql and install using the instructions posted previously here and here and these additional flags:

sudo perl Makefile.PL \
--cflags="-I/usr/local/mysql/include" \
--libs="-L/usr/local/mysql/lib -lmysqlclient -lz -lm" \
--testuser="username" \
--testpassword="password" \
--mysql_config="/usr/local/mysql/bin/mysql_config"

Just replace username and password with whatever your username and password is for your database. Then run make, then make test and if everything checks out okay, run make install.

And that's it!


Useful? Then Digg It.

Del.icio.us | Technorati Tags:

Post a comment


Type the characters you see in the picture above.

Contact Us

Got anything interesting to report or want to tell us? Feel free to email us!

Links

Email Notification

Enter your email address:

Delivered by FeedBurner

Powered by
Movable Type 4.1