Migrating MySQL 5.0.45 to Mac OS X 10.5 Leopard
Posted by Joannou Ng on 2007.11.01 GMT at 18:59
If you Archive and Installed Leopard, and installed MySQL 5.0.45 on your previous OS X using the official MySQL package, then the following will migrate your MySQL to Leopard.
Copy your MySQL over:
sudo cp -pR /Previous\ Systems.localized/datetime_you_installed_leopard/usr/local/mysql-5.0.45-osxyour_previous_os_x_version-your_architecture /usr/local/mysql-5.0.45-osxyour_previous_os_x_version-your_architecture
Copy your MySQL symlink over too:
sudo cp -pR /Previous\ Systems.localized/datetime_you_installed_leopard/usr/local/mysql /usr/local/mysql
Remove the MySQL startup item (we’ll use the preferred launchd instead):
sudo rm -R /Library/StartupItems/MYSQLCOM
Also, right-click and remove the MySQL preference pane in System Preferences because we’ll be using the preferred launchd instead.
Copy this MySQL launchd configuration file to /Library/LaunchDaemons, and change its owner to root:
sudo chown root /Library/LaunchDaemons/com.mysql.mysqld.plist
Change your MySQL owner to mysql:
sudo chown -R mysql /usr/local/mysql-5.0.45-osxyour_previous_os_x_version-your_architecture /usr/local/mysql
Load the MySQL launchd configuration file:
sudo launchctl load /Library/LaunchDaemons/com.mysql.mysqld.plist
Got MySQL?
Comments
There are 14 comments on this post. Post yours →
Thanks for posting this! I just upgraded today and was having mysql issues and this fixed everything! Excellent stuff!
This worked perfectly. I would advice using tab-completion to fill in those pesky file paths. And also, one needs to create /us/local before running the cp command.
This worked perfectly for me. My Erase and Install, followed by the “copy folders” in Migration Assistant, did repopulate /usr/local with all my old Tiger stuff, which I didn’t want (save for MySQL). So this way I could bring it back, get it running without the preference pane problem, and now that I have PHP5 running too my localhosting setup is just as good as it was before. Thanks!
Thanks for this, just what I needed. Never would have sorted it out otherwise.
Joannou, you mention twice the “preferred launchd”. Is this something that is just “preferred” by you personally, or is this now the standard Apple “preferred” mechanism for starting a daemon at boot?
@Ray Zimmerman: Apple introduced launchd in Tiger to supersede the old ways.
More info:
http://developer.apple.com/macosx/launchd.html
Hi Joannou, I met you at Railsconf, you were staying with Enrique. Thanks for the info, it was very useful. Thought I would drop you a line because I moved to Shanghai and I’m doing Ruby on Rails full time now.
Thanks for the great instructions! This got me up and running again on MySQL quickly after I thought I had considered everything I’d need to fix after upgrading to Leopard.
For people who want to know more about Launchd, there’s a presentation by the developer here:
http://video.google.com/videoplay?docid=9134517895937683240
Enjoy!
@ menneke
I did a clean install of Leopard instead of Archive and Install but upon installing MySQL 5.0.45, I received the same error you did. Here is what I did to correct it.
1) Clean install of MySQL 5.0.45 using the OSX 10.4 package from mysql.com
2) Copied the contents of my previous data directory to the new one (/usr/local/mysql/data)
3) Changed owner to mysql sudo chown -R mysql /usr/local/mysql sudo chown -R mysql /usr/local/mysql-5.0.45-osx10.4-i686
4) Follow Joannou’s instructions above for replacing the Startup Item with a launchd config.
After that I had a working copy of MySQL 5.0.45 on Leopard.
Yay, it worked! Thanks!
Thanks so much. This worked great, & saved my sanity, as well!
Thanks so much for the tip! I hadn’t needed to use mysql since upgrading to Leopard and started to get a headache at the prospect of fixing this. These steps worked perfectly!
thx for the post had been struggling to get the installation right on Leopard
Thanks for taking the time to write this up.. saved me a lot of time.
Post a comment
Required fields in bold.