You need to download the Source to MySQL 5, it’s the tar file called mysql-5.0.45.tar.gz, unpack it and open a Terminal session where you cd into the source directory and execute the following commands. Please note the different configure instructions for Intel or PowerPC based Macs:

Tiger 10.4.x, for Intel:

CFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk" \
./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

Tiger 10.4.x, for PowerPC:

CFLAGS="-arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk" \
./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

Leopard 10.5.x, for PowerPC and Intel:

./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 all:

make

sudo make 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