Mac OS X 10.5 Server comes with the MySQL pre-installed. However, the database server doesn't ship with the client version of OS X 10.5 Leopard, which most of us Mac users run. Here are the notes I took, putting MySQL 5.1 on a 2 GHz Intel Core Duo based iMac (none 64 bit) running OS X 10.5.2 (Client)
Installing MySQL 5.1 on OS X 10.5 (Leopard) Client
Download the pre-compiled module package in form of a diskimage (dmg), available at
http://dev.mysql.com/downloads/mysql/
For the 2 GHz Intel Core Duo based iMac, I downloaded the 32-bit version mysql-5.1.23-rc-osx10.5-x86.dmg. Newer Macs, featuring a Core-2-Duo processor should work best with the 64-bit version.
Open (double-click) the dmg file, followed by running (double-click) the mysql-5.1.23-rc-osx10.5-x86.pkg package installer.
The package installer will install the mysql into
/usr/local/mysql-5.1.23-rc-osx10.5-x86
and also create this shortcut
/usr/local/mysql/
Installing the Preferences Pane won't do us any good, it does not work anymore with OS X 10.5. Instead, the launchd mysql.plist file needs to be created and stored in /Library/LaunchDaemons/ and also given ownership to root:
sudo chown root:wheel /Library/LaunchDaemons/mysql.plist
mysql.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>GroupName</key>
<string>mysql</string>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.mysql.mysqld</string>
<key>Program</key>
<string>/usr/local/mysql/bin/mysqld_safe</string>
<key>UserName</key>
<string>mysql</string>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
This command line can now be used to start MySQL:
sudo launchctl load /Library/LaunchDaemons/mysql.plist
and to stop it:
sudo launchctl stop mysql
sudo launchctl unload /Library/LaunchDaemons/mysql.plist