OS X Leopard and MySQL Update

Monday, 7. April 2008

I should have looked before I wrote my last post on MySQL because there is an updated version of the MySQL package for OS X 10.5. (And it has been available for quite a while too.) I undid everything I had done previously to get MySQL working before and I downloaded and installed the 64-bit version of this new package. I even took myself out of the wheel group.

After installing the updated package I found that I could not start MySQL from the command line or the prefpane. I tried adding myself back to the wheel group but I still couldn't start MySQL. To fix the problem I still had to follow the recommendation to change the ownership of /usr/local/mysql/data that I originally found here. Then I removed myself from the wheel group and I could still start and stop MySQL from both the command line and the prefpane. I'm not sure that changing the permissions is either really necessary or the best solution to the problem but it works.

Then I tried restarting the system to see if the permissions on /usr/local/mysql/data/<computer name>.local.err were getting reset like they were before. They weren't, so that's one less problem to deal with.

Finally I tried enabling automatically starting MySQL on system start and that works now even if your user is not in the wheel group.

So now (almost) everything in the MySQL package for OS X 10.5 works out of the box.

Delicious Facebook Google Buzz Google Reader LinkedIn Twitter Email

Automatically Start MySQL on Startup in OS X Leopard

Monday, 7. April 2008

In an earlier post I explored how to install MySQL from a package on OS X Leopard, but I left unsolved the problem of how to make MySQL start automatically on system startup. This morning while reading Mac OS X Hints a post titled “10.5: Join 'wheel' group as possible fix for system issues” caught my eye and started me thinking that perhaps it might also be a solution for the MySQL auto-start problem I had been unable to solve.

First I had to find a way to add myself to the wheel group so followed a link from that hint to another hint titled “10.5: Manage users and groups using a GUI tool*. From there I downloaded and installed Apple's Server Admin Tools for 10.5. These tools are not meant to be used with the desktop version of OS X, but the Workgroup Manager tool works and can be used add a user to a group. I followed the steps described and added myself to the wheel group. It took me a couple of minutes to find the wheel group because the Workgroup Manager displays the groups' long names instead of their short names. In the case of the wheel group the long name is System Group.

wheel_group

After adding myself to the wheel group I opened the MySQL prefpane in System Preferences and checked “Automatically Start MySQL Server on Startup”. Then I shut down and restarted my MacBook. When it finished booting I logged in and MySQL was already running. Problem solved!

AutoStartMySQL


*Mac OS X Hints offers the following warning for this hint:

Warning: You should not play around with these settings if you don't know what you're doing. It is possible to break certain parts of the operating system, or to render it unusable.

You should definitely not add users to the wheel group unless you are reasonably confident that you know what you are doing and what the security implications are.

Delicious Facebook Google Buzz Google Reader LinkedIn Twitter Email

OS X Leopard and MySQL

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.

MySQL.prefpane

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.

Delicious Facebook Google Buzz Google Reader LinkedIn Twitter Email


 
 

Switch to our mobile site