Tuesday, 5. February 2008
There are two options for installing MySQL on OS X, assuming you aren't running OS X Server which includes MySQL. The first option is to install it from source. The second option is to install it from a package. I've installed MySQL from source before and it is not a terribly difficult process, but for some unknown reason (perhaps related to my incorrigible tendencies towards sloth) I had a strong preference for installing it from the package.
The problem was that the current MySQL package isn't exactly compatible with OS X Leopard. I found a solution to that problem in this post on The Blog that Noone Reads. As suggested there, changing the owner of all of the files and folders found in
/usr/local/mysql/data fixed the problems I had with MySQL after installing it from the package. Almost. Every time I rebooted MySQL would refuse to start from the prefpane. It turned out that there was a log file whose ownership was getting reset every time I restarted. The fix for that was to leave the ownership on that file alone and to change its permissions instead. Remember to change
<computer name> to the computer name of your Mac before running the following command:
sudo chmod a+rw /usr/local/mysql/data/<computer name>.local.err
After changing the permissions of that log file I am able to start and stop MySQL from the prefpane even after rebooting.
There is still one problem left to solve – I cannot get MySQL to automatically start. But as usual I decided to declare victory at the 90% success mark and leave a bit of the problem unsolved to satisfy the procrastinator in me. Besides, I didn't want MySQL to start automatically anyway.