Bug #35294 Cannot start/stop MySQL from System Preferences Bug Continues
Submitted: 14 Mar 2008 15:08 Modified: 14 Mar 2008 18:22
Reporter: Peter Mackie Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Installing Severity:S1 (Critical)
Version:mysql-5.0.51a-osx10.5-x86 OS:Mac OS X (Leopard)
Assigned to: CPU Architecture:Any
Tags: 10.5, leopard, start MySQL, stop MySQL, system preferences

[14 Mar 2008 15:08] Peter Mackie
Description:
On Mac OS X Leopard 10.5.2 running mysql-5.0.51a, you cannot start or stop MySQL from the System Preferences. This same problem has been identified three other times with no resolution.

Bug #25008 Mac OS X's StartupItem does not work, 12 Dec 2006

Bug #28854 MySQL.prefPane does not start or stop mysql on osx 10.5, 3 June 2007

Bug #31889 Cannot start MySQL from System Preferences, 26 Oct 2007

Bug #Bug #31889 was automatically closed on 28 Nov 2007, yet this problem continues to persist some four months later.

Additionally the mysql-5.0.51a "ReadMe.txt" contains an error, in the following text:

The Startup Item for MySQL is installed into
`/Library/StartupItems/MySQLCOM'. (Before MySQL 4.1.2, the location was
`/Library/StartupItems/MySQL', but that collided with the MySQL Startup
Item installed by Mac OS X Server.) Startup Item installation adds a
variable `MYSQLCOM=-YES-' to the system configuration file
`/etc/hostconfig'. If you want to disable the automatic startup of
MySQL, simply change this variable to `MYSQLCOM=-NO-'.

  1. The "MySQLStartupItem.pkg" does not install  
     `/Library/StartupItems/MySQLCOM' as stated above.
     The "find" command did not located the file MYSQLCOM 
     anywhere on my disk drive.

  2. `MYSQLCOM=-YES-' is not written in `/etc/hostconfig' as 
      stated above. There is no MYSQLCOM entry in `/etc/hostconfig'

  3. The `/etc/hostconfig' file states at the top, 
     "# This file is going away". 
     Long term do we need to be concerned about this?

How to repeat:
Try to start and stop MySQL server via System Preferences on Mac OS X Leopard

Suggested fix:
An interim MySQL server auto-start (reboot) solution follows:

o Create a file named "com.mysql.mysqld.plist", on your desktop, containing the following content:

?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>KeepAlive</key>
	<true/>
	<key>Label</key>
	<string>com.mysql.mysqld</string>
	<key>Program</key>
	<string>/usr/local/mysql/bin/mysqld_safe</string>
	<key>RunAtLoad</key>
	<true/>
</dict>
</plist>

o Copy the "com.mysql.mysqld.plist" to your "/Library/LaunchDaemons/" folder:
  hostname:~ username$ sudo cp Desktop/com.mysql.mysqld.plist /Library/LaunchDaemons/
  hostname:~ username$ 

o Check for proper file 'root:wheel' 'owner:group' name:
  hostname:~ username$ ls -l /Library/LaunchDaemons/
  total 8
  -rw-r--r--@ 1 root  wheel  374 Mar 14 04:54 com.mysql.mysqld.plist
  hostname:~ username$ 

  If necessary, change file owner to 'root:wheel' using the "chown" command.
  hostname:~ username$ sudo chown root:wheel /Library/LaunchDaemons/com.mysql.mysqld.plist
  hostname:~ username$ 

o Start your MySQL server by loading the launchd configuration file:
  hostname:~ username$ sudo launchctl load /Library/LaunchDaemons/com.mysql.mysqld.plist

Your MySQL server will now be running and will auto-start at system startup or reboot.

Note the the above MySQL server auto-start fix does not fix MySQL stop/start Mac OS X System Preferences problem. It will continue to inoperable, i.e., it will neither start nor stop the MySQL server.
[14 Mar 2008 16:28] Peter Mackie
The original bug report statement:

 2. `MYSQLCOM=-YES-' is not written in `/etc/hostconfig' as 
     stated above. There is no MYSQLCOM entry in `/etc/hostconfig'

is in error. I did subsequently find the `MYSQLCOM=-YES-' in the `/etc/hostconfig' file. Sorry for the confusion.
[14 Mar 2008 18:22] Sveta Smirnova
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments to the original bug instead.

Thank you for your interest in MySQL.

Binaries with fix of bug #25008 and bug #28854 are not available yet. Please wait next release.
[21 May 2008 10:59] Pietro Pugni
I've createad a little application that substitutes the ufficial pref pan.
I hope you'll find it useful.
For bugs, comments and suggests please contact me at preiser2[at]gmail[dot]com

Link at the download page: http://preiser.altervista.org/index.php?page=mac&crono=mac