Fix for MySQL Community Server 5.5.8 on Snow Leopard

I recently installed MySQL Community Server 5.5.8 (download link) on one of my MacBooks. One of the nice things about the DMG version of MySQL for Snow Leopard is that it comes packaged with a prefpane entry. This adds a MySQL pane to System Preferences and allows for one-click Starting and Stopping of the MySQL server from a GUI interface.

Unfortunately on my machine, this entry did absolutely nothing. If I clicked the Start MySQL Server button I was prompted for my password, and then nothing at all happened.

Something was amiss. My next instinct was to check /var/log/system.log. Here (among other things) I found the error:

/usr/local/mysql/support-files/mysql.server: line 256: my_print_defaults: command not found

Evidently, something was set up wrong in my mysql.server file, because my OS was unable to find a command that it was supposed to be running. Possibly a $PATH issue. I opened it up and took a look at line 256, which read:

parse_server_arguments `$print_defaults $extra_args mysqld server mysql_server mysql.server`

Sure enough, the mysql.server is trying to run mysql and can’t find it.

The Fix:

We need to point mysql.server in the right direction. To do this, open mysql.server and search for Set some defaults to get close to where we need to work. A few lines after this, change

basedir=.

to

basedir=/usr/local/mysql

Once that’s fixed, search for Set pid file if not given, and a few lines under this change

mysqld_pid_file_path=$datadir/`hostname`.pid

to

mysqld_pid_file_path=$datadir/`/bin/hostname`.pid

Save the file and reopen System Preferences->MySQL. Click the Start MySQL Server button and the MySQL server should now start.

Michael is the creator and main author of the Smalley Creative Blog. He is a guy who enjoys technology (particularly open source), educating people about technology, and working with people who enjoy technology as much as he does. Follow him on Twitter @michaeljsmalley.

Leave a reply:

Your email address will not be published.

Site Footer