MySQL Prebuilt Binary for Mac OSX

by Gavin Clark <gavin@datacor.com>

Other pages

Apache Control

OSX goodies

News

5/5/01 - New version of PHP. 4.0.5 - this one compiled out of the box.

4/20/01 - Bug fix! If you have installed the mysql package please run the bug fix below.

4/9/01 - Newer version! MySQL-3.23.36

4/8/01 - I put the whole thing into an installer package so the mile long list of instructions is no more. It's now about as easy as it gets!

Download

PHP

PHP in OSX doesn't work right so I just stuck a Pre-Built PHP module here. Just untar gzip it and put it in /usr/libexec/httpd/

set file permissions - as root in terminal
chown root /usr/libexec/httpd/libphp4.so
chmod 755 /usr/libexec/httpd/libphp4.so

Don't forget to to edit the httpd.conf file to uncomment the lines relating to php.

LoadModule php4_module libexec/httpd/libphp4.so
AddModule mod_php4.c
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

tip:
To make ALL your html pages execute php code alter the AddType type line to include the .html sufix
AddType application/x-httpd-php .php .html

Restart apache and try out a php page.

Note: I had a problem where apache wouldn't start after I installed this copy of PHP - the problem was Stuffit Expander. It mangled the file when it un stuffed it. I unstuffed it again and it worked fine.

MySQL

I created this MySQL binary by compiling the source code then running the included 'make binary distribution' script.

To install:

  1. Download the installer package.

  2. Drop the .tgz file onto stuffit expander.

  3. Double click the resulting installer (.pkg) file.

  4. The installer puts MySQL in it's own folder in Applications

  5. Read the ReadMe.rtf file in the installed mysql folder for more instructions.

		

By installing from a binary you will get something a little different than what you get if you compile it yourself. The parts are all in one folder instead of scattered all over your disk, which I think is a better way to do it. You can stick the folder anywhere you want, I put mine in the Applications folder. You'll have to type the full path to the binaries to make them work from the terminal:

instead of
mysql -u bob -p football_stats

you type
/Applications/mysql/bin/mysql -u bob -p football_stats

Bug fix

The previous version of the installer used a user id number that was already in use. The error won't hurt anything but it may cause some confusion when you see that the file permissions don't say 'mysql'.

To fix it follows these instructions. Thanks.


First stop the mysql server. (instructions are in the read me file in /Applications/MySQL-3.23.36)

run these commands in the terminal:

su

niutil -createprop / /groups/mysql gid 85

niutil -createprop / /users/mysql uid 85

niutil -createprop / /users/mysql gid 85

/usr/sbin/chown -R mysql /Applications/MySQL-3.23.36/data/