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.