Getting MySQL Preference Pane To Work In Leopard

The most visited post on my blog is the post regarding a fix for getting MySQL to run on Leopard. Today, Charlie Jackson posted a comment to that post with a fix he discovered for getting the preference pane to work so you no longer have to start/stop MySQL via the commandline. So that it wouldnt be buried in the comments, I decided to post it here.

First, open a terminal window and enter the following commands:

cd /usr/local/mysql/support-files

mv mysql.server mysql.server.real

touch mysql.server

Next, you will need to edit the new mysql.server file that we just created with the touch command. I used textmate by simly typing "mate mysql.server", but you could use vi or whatever you want.

Once you have the file open for editing, simply enter the following code into the file and save it.

#!/bin/sh

sudo /usr/local/mysql/support-files/mysql.server.real $1

Once this was done, I had to change the permissions on the file to get it to work so I ran the following in the terminal:

sudo chown root:wheel mysql.server

sudo chmod +x mysql.server

After that, fire up your system preferences and test the MySQL pane. Mine starts and stops the server perfectly.

Thanks again Charlie!

----- UPDATE! ------

Lars posted in the comments below a link to a patched pref pane that has been FINALLY released! Thanks for pointing this out Lars!

I have installed it on both my 24" iMac and my MBP and it works great!

Grab it here


Fix for MySQL on Leopard

After upgrading, I found that there are a few incompatibilities with several applications. Thats to be expected I guess. The two biggies for me is CF 8 and MySQL. I havent managed to get CF 8 running yet but I found a fix for MySQL.

It seems that the preference pane will not work to start or stop MySQL yet so you will have to start it manually from the command line and create a link to the socket file.

First, start MySQL in a terminal window with the following command:

sudo /usr/local/mysql/bin/safe_mysqld

Then either close the terminal and open a new one, or just hit Command-N to open a new terminal window. Then type the following:

sudo mkdir /var/mysql/

And lastly, create a symbolic link to point the default socket file:

sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

I will keep posting things as I find problems and fixes.

--== UPDATE ==--

Charlie Jackson posted a fix for getting the preference pane to work. I have posted a write up of the fix here.