Note: These instructions presume you first installed MySQL via the binary installation package and then compile the source code to get proper shared libraries.
You need to download the Source to MySQL 5.0.x, it’s the tar file called mysql-5.0.xx.tar.gz (xx is version number), unpack it and open a Terminal session where you cd into the source directory and execute the following commands.
For Intel use:
CXXFLAGS="-arch x86_64" \
/configure -prefix=/usr/local/mysql \
-localstatedir=/usr/local/mysql/data \
-libexecdir=/usr/local/mysql/bin \
-libdir=/usr/local/mysql/lib \
-with-server-suffix=-standard \
-enable-thread-safe-client \
-enable-local-infile \
-enable-shared \
-with-zlib-dir=bundled \
-with-big-tables \
-with-readline \
-with-archive-storage-engine \
-with-innodb \
-without-docs \
-without-bench
For PowerPC use
CXXFLAGS="-arch ppc64" \
/configure -prefix=/usr/local/mysql \
-localstatedir=/usr/local/mysql/data \
-libexecdir=/usr/local/mysql/bin \
-libdir=/usr/local/mysql/lib \
-with-server-suffix=-standard \
-enable-thread-safe-client \
-enable-local-infile \
-enable-shared \
-with-zlib-dir=bundled \
-with-big-tables \
-with-readline \
-with-archive-storage-engine \
-with-innodb \
-without-docs \
-without-bench
Follow for both with:
And if that went without errors you are ready to install:
And now you’ve got a proper MySQL installation with shared libraries. Which means you can compile and install all kinds of software that requires access to MySQL databases.
Next step: Securing your MySQL install



12:12 am
Getting a problem when trying to compile mysql after following all you other instructions. This is probable a simple issue but I can’t get my head around it. I get “-bash: ./configure: No such file or directory” at the commands listed above. I compiled Apache correctly and I know my path looks good. Ideas? Thanx
8:18 am
Jared, are you sure you’ve downloaded the correct source package from Mysql.com. It should be one of the last packages at the bottom of the download page.
10:03 pm
What are the impacts of using 64 bit instead of 32? Do I have to (re)compile everything in 64 bit mode to have everything work together? E.g., can Apache compiled in 64 bit mode run mods compiled in 32 bit mode – or can it only run 64 bit mods? Thanks for your help!
7:04 am
Grant, if you compile MySQL in 64 bits mode you will have to compile PHP in 64 bit mode and therefore also Apache. This means you’d better of compiling everythign in 64 bits mode. It will make everything just a bit quicker!