記事のページ

How to install MAMP (DBD::MySQL) on Mac OS X 10.6

fukusima.jpg
I would like to show you my way to install some libraries for installing "MAMP" and "DBD::MySQL" on Mac OS X 10.6 Snow Leopard.
I'm sure this will be some help to someone, but I'm afraid my broken-English doesn't help much.
Now, let us go.
by FOXBAT living in Japan under The disaster at the Fukushima Daiichi nuclear plant in 3.11.
First,you have to install "X11" and "Xcode" on your Mac.

1. Installing MySQL on Mac OS X 10.6 Snow Leopard
Download "MySQL (package format for Mac OS X 10.6 Snow Leopard)" from MySQL Archives for Mac OS X,and install.
Never download 32bit packages, because you will be failed to install "DBD::MySQL".

2. Installing libjpeg on Mac OS X 10.6 Snow Leopard
"ImageMagick" depends upon other libraries, such as zlib, libpng, and libjpeg. If you have installed "X11" and "Xcode", your Mac includes current versions for all but libjpeg, so we have to install libjpeg.
Open Terminal.
Type,
sudo mkdir -p /usr/local/include
sudo mkdir -p /usr/local/bin
sudo mkdir -p /usr/local/lib
sudo mkdir -p /usr/local/share/man/man1
Download "jpegsrc.v8b.tar.gz" , and unzip the file to your Desktop.
Open Terminal,again.
Type,
cd Desktop/jpeg-8b
cp /usr/share/libtool/config/config.sub .
cp /usr/share/libtool/config/config.guess .
Lines wrapping without line spacing are a single command for 64-bit use, Type,
MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" LDFLAGS="-arch x86_64" ./configure --enable-shared
And then, find "makefile" in "jpeg-8b"folder on your Desktop, and open "makefile",
and change,
mandir = $(prefix)/man/man$(manext)
to
mandir = $(prefix)/share/man/man$(manext)
and save.
Return Terminal, and Type,
make
make test
sudo make install

3. Installing ImageMagick on Mac OS X 10.6 Snow Leopard
Download "ImageMagick (6.6.0-8)"-(other virsions will be ok)- from "ImageMagick.tar.gz"of"Unix Source" ,and unzip the file to your Desktop.
Open Terminal.
Type step by step,
cd Desktop/ImageMagick-6.6.0-8
./configure
make
make test
sudo make install
We want to use "PerlMagick" for "MovableType",
so,continue to type,
cd PerlMagick
perl Makefile.PL
make
sudo make install
"./configure" and "make" needs VERY LONG TIME, so you should open your "iTunes" and play "your favorite album".
Now, "ImageMagick" and "PerlMagick" were installed for "MovableType".

4. Installing DBD::MySQL on Mac OS X 10.6 Snow Leopard
Your Mac with "X11" will include "DBI (1.607)",but not "DBD::MySQL".
Download "DBD::MySQL (4.014)"-(other virsions will be ok)- from cpan ,and unzip the file to your Desktop.
Start your "MySQL" from control panel on your Mac.
We need the MySQL client libraries and headers for installing "DBD::MySQL"
Open Terminal.
Type,
sudo mkdir /tmp/mysql-lib
cd /usr/local/mysql/lib
sudo cp *.a /tmp/mysql-lib
DBD-MySQL1.jpg
Now we made a directory and copied the needed files of mysql for installing "DBD::MySQL".
Let's install "DBD::MySQL".
Open your Terminal !
Type,
cd Desktop/DBD-mysql-4.014
Lines wrapping without line spacing are a single command.
Type as one line,
perl Makefile.PL --libs="-L/tmp/mysql-lib -lmysqlclient" --mysql_config=/usr/local/mysql/bin/mysql_config --testhost=localhost -testuser=root
We have to add the line ( --testhost=localhost -testuser=root) for "make test". ( Please look at the first picture.(My Mac Pro's name is "STEALTH",and My UserName is "FOXBAT". ) )
If your mac were installed Snow Leopard virsion 10.6.3~10.6.5, type on your terminal
make
make test
sudo make install
DBD_MySQL2.jpg
I think that you will get no errors and be able to install "DBD::MySQL" successfully.
But if your Snow Leopard was updated to latest virsion, you will be failed to install "DBD::MySQL".
I think that the construction of the files for 32bit mode may be changed on late Snow Leoprad,in order to available for new iOS.
And then, find "makefile" in "DBD-mysql-4.014"folder on your Desktop, and open "makefile", (Please look at the second picture.)
and change, line about 44or45,
LDDLFLAGS = -arch x86_64 -arch i386 -arch ppc -bundle -undefined dynamic_lookup -L/usr/local/lib
LDFLAGS = -arch x86_64 -arch i386 -arch ppc -L/usr/local/lib
to
LDDLFLAGS = -arch x86_64 -bundle -undefined dynamic_lookup -L/usr/local/lib
LDFLAGS = -arch x86_64 -L/usr/local/lib
and change, line about 314,
CCFLAGS = -arch x86_64 -arch i386 -arch ppc -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -I/usr/local/include
to
CCFLAGS = -arch x86_64 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -I/usr/local/include
and save.
Return Terminal, and Type,
make
make test
if you get no errors, type
sudo make install
That's all!

5. To Use DBD::MySQL from your "MAMP"
If you want to use DBD::MySQL for your "MAMP",you have to make "mt-config.cgi" by youself without "mt-wizard.cgi".
#================ DATABASE SETTINGS ==================
# REMOVE all sections below that refer to databases
# other than the one you will be using.

##### MYSQL #####
ObjectDriver DBI::mysql
Database mt
DBUser root
DBPassword XXXXX
DBHost localhost
DBSocket /Applications/MAMP/tmp/mysql/mysql.sock
DBPort 8889
Add last 2 lines on "mt-config.cgi"!
That's all!

This ain't a song for the broken-hearted
No silent prayer for the faith-departed

I ain't gonna live forever
I just want to live while I'm alive
My heart is like an open highway
Like Frankie said "I did it my way"

"It's my life"

"It's my work" from Japan under The disaster in 3.11.

この記事について

この記事は著者が2011年10月 2日に書いたものです。

コメントおよびツッコミ大歓迎です。
すべてのコメントに目をとおさせていただいておりますが、そのうちのいくつかを選んで公開しておりますので、ご了承いただけたら幸いです。

この記事は "マックの道具箱" カテゴリ内の記事です。

カテゴリ内の前の記事は
Mac OS X 10.6 と DBD::MySQL」です。

最近の記事はメインページで見られます。過去に書かれた記事はアーカイブで見られます。著者自身の撮影した写真は、写真集でご覧になれます。

Made on a Mac