If you're running MySQL and PHP under Leopard, be prepared to jump through hoops to get it going.
This is the 'basic' processs to get MySQL 5.0.45 running on Leopard.
1. Install the 5.0.45 package for OSX from mysql.com
2. Open the terminal and change ownership of all the files inside the /usr/local/mysql folder to _mysql:wheel. The terminal command would be "cd /usr/local/mysql; sudo chown -R _mysql:wheel *" (without the quotes). Then type in your password when prompted.
3. Next, go to /etc/apache2 ("cd /etc/apache2" in Terminal). Then you'll want to open the httpd.conf file as an admin user ("sudo pico httpd.conf"). Now you'll want to uncomment the line that says "LoadModule php5_module libexec/apache2/libphp5.so". I find it's easiest to find it by typing 'Ctrl-W' (Where Is?) and then typing 'libphp' and press Return. Just remove the '#' character at the beginning of the line and save the file ('Ctrl-X', answer yes when prompted). You'll have to restart the webserver if you're using the /Library/Webserver directory, or restart Personal Web Sharing if you're using your ~/Sites directory.
4. Now we have to get PHP and MySQL to communicate with each other. Unfortunately Apple's default PHP install looks for the MySQL socket in /var/mysql/ rather than in the /tmp directory where it actually resides. So, what you need to do is create a symbolic link between the two locations so that PHP and MySQL will be happy.
This is also done in the Terminal, by first changing to the /var directory, creating the mysql directory, then creating the socket link inside the directory.
In Terminal-speak: "cd /var; sudo mkdir mysql; cd mysql; sudo ln -s /tmp/mysql.sock ." (once again without quotes. DON'T forget the period after mysql.sock... this tells the terminal shell to create the link in 'this' directory.
5. Now, the final thing is to create a LaunchDaemon for mysql, since MySQL won't auto-start using the Preference Pane under Leopard. Just create a text file with the following text in it:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs$
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.mysql.mysqld</string>
<key>Program</key>
<string>/usr/local/mysql/bin/mysqld_safe</string>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
Save it as "com.mysql.mysqld.plist". Drag it to /Library/LaunchDaemons and enter your admin password if prompted. You also want to make sure that the plist file is owned by root, so change to the /Library/LaunchDaemons directory in the Terminal (cd /Library/LaunchDaemons), then type "sudo chown root:wheel com.mysql.mysqld.plist". Now MySQL should start up automatically on reboot.
Now you just have to create the root password for the MySQL installation.
This Link should help you get that taken care of.
I've found the easiest way to make sure that PHP/MySQL are installed correctly is to download and install PHPMyAdmin in your Sites folder (the url of the install would be something like "http://127.0.0.1/~yourusername/phpMyAdmin/index.php"). Follow the configuration steps in the Read Me files that come with it, and you should be good to go.
Are you scared yet?
