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-file
<p>mv mysql.server mysql.server.real</p>
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 simply 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














sudo mv mysql.server mysql.server.real
and
sudo touch mysql.server
However, its still not working... the mysql pref pane just gives me neverending pin-wheel when I either Start or Stop. I can start through command line, so I guess that will have to do for the time being. Really strange cause I got this whole setup to work flawlessly a few weeks ago on my other mac.
After restart the thing won't work.
If I start mysql using Terminal, then the preference panel works fine, but it won't work if I haven't manually started mysql.
Any ideas?
These are the permissions for the things in the 'support-files' directory:
-rw-r--r-- 1 root wheel 3316 14 Jan 20:07 MySQL-shared-compat.spec
-rw-r--r-- 1 root wheel 3383 12 Jan 01:43 compiler_warnings.supp
-rw-r--r-- 1 root wheel 773 12 Jan 01:43 magic
-rw-r--r-- 1 root wheel 4933 14 Jan 20:07 my-huge.cnf
-rw-r--r-- 1 root wheel 20910 14 Jan 20:07 my-innodb-heavy-4G.cnf
-rw-r--r-- 1 root wheel 4909 14 Jan 20:07 my-large.cnf
-rw-r--r-- 1 root wheel 4916 14 Jan 20:07 my-medium.cnf
-rw-r--r-- 1 root wheel 2486 14 Jan 20:07 my-small.cnf
-rwxr-xr-x 1 root wheel 41921 14 Jan 20:07 mysql-5.0.51a.spec
-rwxr-xr-x 1 root wheel 839 14 Jan 20:07 mysql-log-rotate
-rwxr-xr-x 1 root wheel 68 3 Feb 17:13 mysql.server
-rwxr-xr-x 1 root wheel 11147 14 Jan 20:08 mysql.server.real
-rw-r--r-- 1 root wheel 41921 14 Jan 20:07 mysql.spec
-rw-r--r-- 1 root wheel 926 14 Jan 20:07 mysqld_multi.server
-rw-r--r-- 1 root wheel 589 14 Jan 20:07 ndb-config-2-node.ini
So those two files are -rwxr-xr-x. Is this what they should be? (I included the others just in case they had any impact.)
Otherwise, it's the same. After restarting the machine if I try and use the preference panel to turn it on, I get the infinite pinwheel and have to force quit system preferences ("not responding").
If I start safe_mysqld in terminal, it all comes good again.
Any ideas? (I have just erased and installed Leopard, with minimal extras.)
I missed the $1 parameter in mysql.server
Thanks for the fix. This had been bugging me for a while.
It was driving me nuts that I couldn't use the pref pane to start/stop mysql! I was about to write an automator app to run the command line actions, but I thought that would be unnecessary.
Now the pref pane works like it should!
I remember reading somewhere in my scourings that yes, the user has changed to have the extra underscore, but that either 'mysql' or '_mysql' works (i.e. they're interchangeable) – unfortunately I can't remember where I read it …
Still, once I've started mysql using the Terminal, the preference pane comes good and all is rosy - a bit of a pain, but it only takes a few seconds …
ftp://ftp.mysql.com/pub/mysql/download/gui-tools/MySQL.prefPane-leopardfix.zip
MySQL finally (FINALLY!) fixed the goddamn pref pane. However, the guy who points us to this - a commenter to <a href="http://bugs.mysql.com/bug.php?id=28854">this post</a> (Alfredo Kojima), also points out that the OTHER problem with many Leopard installs of MySQL not working right (or not working at all) was that the MySQL data directory had incorrect permissions on it. The fix for that is: sudo chown -R mysql:wheel /usr/local/mysql/data
Hope this helps anyone still having trouble. Worked for me.
This plus PHP and Apache put me in business.
Thanks for this thread and all this information.
When you change the permissions on the created file in the instructions using:
sudo chown root:wheel mysql.server
change "root" to whatever your current admin username is.
for example
sudo chown tferguson:wheel mysql.server
Thanks, Ed
I updated but no longer need mysql.
first of all thanks to Lars and the Pref-Pane-Fix.
I found out (thanks to an Italian blog) how to fix the startup issue.
You have to move MYSQLCOM to /Library/StartupItems/
type in Terminal:
sudo mv /usr/local/MySQLCOM /Library/StartupItems/
Now everytime you shut down or reboot MYSQL will automatically start (if checked in the Pref-Pane)
Cheers
tnx to ideafactory.it
#!/bin/sh
sudo /usr/local/mysql/support-files/mysql.server.real $1
Russ gave this command: mate mysql.server
It didn't work for me so i found an alternative command instead of mate I used "pico" I also had to add sudo before each of my commands
so this is what it looked like: sudo pico mysql.server
By the way. It might be first in the post... But thanks.
Thanks for giving me one solution/reason to not wipe this MBP and go back to Tiger tonight.
This worked fine for me on Tiger.
I tried the above suggestions to get the MySQL Preference Pane fixed, but it was not working.
So, I decided to install the newest version of the MySQL community server from www.mysql.com.
After downloading the 10.5 package, I double clicked on the MySQLStartupItem.pkg and installed it.
Next, I double clicked on the MySQL.prefPane, and the installed alerted me that I had an old version of the preference pane installed. It then politely asked if I would like to overwrite the old version. I selected "yes", and it installed the newest version.
After these steps, the preference pane worked again! No terminal required!
I DID NOT INSTALL THE NEWEST .pkg VERSION OF MYSQL, just the MySQLStartupItem.pkg and MySQL.prefPane. I was satisfied with my current version of MySQL, so I decided not to go through the process of installing a newer version.
Hope this helps!
http://www.bytebot.net/blog/archives/2008/04/06/mysql-on-leopard-os-x-105-prefpane-fixed
Colin has uploaded a new prefpane with a fix here: ftp://ftp.mysql.com/pub/mysql/download/gui-tools/MySQL.prefPane-leopardfix.zip
I replaced and mysql server worked like a charm.