MySQL + Leopard: startup item pkg problems
Posted by jacqui maher on February 15, 2008 at 09:46 PM
I recently did a clean installation of Leopard after finding that my upgraded-to-leopard mac was having all sorts of issues - basically things got really slow. It got to the point that it was close to impossible for me to get any work done between the ever-present pinwheel and my growing frustration.
Things are a lot better now with Leopard. However, I’ve had to do some things differently while getting setup with the various programs and servers I need for development.
Here’s a relatively minor one that I dind’t find too many blog posts about, so I figured I would write one up quickly in case anyone else runs into this issue.
The MySQL disk images don’t install the startup program in the same place on Leopard that they did in previous versions of OSX. According to the docs:
If you want MySQL to start automatically during system startup, you also need to install the MySQL Startup Item. It is part of the Mac OS X installation disk images as a separate installation package. Simply double-click the MySQLStartupItem.pkg icon and follow the instructions to install it. The Startup Item need be installed only once. There is no need to install it each time you upgrade the MySQL package later.
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-.
(from http://dev.mysql.com/doc/refman/5.0/en/mac-os-x-installation.html)
I installed MySQL using the mysql-5.0.51a-osx10.4-i686.pkg and the MySQLStartupItem.pkg, along with the MySQL.prefPane. I noticed that MySQL was not starting up when I booted my computer. I also noticed that the prefPane wasn’t starting or stopping the server.
The problem? The startup item is not being installed by that MySQLStartupItem.pkg - I’m not sure that installer does anything at all to be honest. The MySQL server installer, otoh, installs the startup item in /usr/local/MySQLCOM
Here’s what to do to fix it:
1. move the MySQLCOM directory into right location:
1 $ mv /usr/local/MySQLCOM/ /Library/StartupItems/
This will get MySQL starting up when your OS does. The prefPane start/stop button still won’t work though, so…
2. You can try downloading an alternate prefPane. I grabbed this one: http://creativeeyes.at/tools/mysqlpp.php
However, I couldn’t get it to install. The prefPane isn’t that important to me though, as I’m fine with starting up the server from the command line. If you moved your startup item to the /Library/StartupItems directory, you can just do this:
1 $ /Library/StartupItems/MySQLCOM/MySQLCOM start
2 Starting MySQL database server
You can make an alias to that command for brevity’s sake too:
1 alias start_mysql="/Library/StartupItems/MySQLCOM/MySQLCOM start"
Stick that in your .profile, source ~/.profile, and you’re set.
Hope this helps.
no time like the present
Posted by jacqui maher on February 07, 2008 at 11:47 AM
regretfully - in terms of getting my gems and adhering to the schedule described in my previous post - life has been especially busy for me, mostly with regards to my full time job and my (recently acquired) freelance gig. when i have so little time that the choice is basically to walk my dog or to finish writing a ruby gem, well, there is no choice, obviously!
it’s going to have to wait. i’ve worked on it a little bit in pockets of five-to-ten minutes over the week. i’m really just trying to get high test coverage on it, as it does wipe out your test directory (with backups… and one should always backup, and use an SCM ffs, but still) and is my first to-the-public gem.
anyway. more later.