Thought this might be a useful addition to my other post “Installing MySQL on Mac OS X”
To start off go and get the latest version of MySQL. Hopefully you have downloaded a nice diskimage (.dmg) this should contain the startup item install package (.pkg) and the MySQL package (.pkg) there is normally also a control panel in the diskimage. I don’t use the startup item as I like to just turn on MySQL when I want it.
Ok make sure MySQL is off, if you have MySQL installed and the control pannel just go to ‘System Preferences’ and click the MySQL icon and hit the ‘Stop MySQL button. Ok Install the the MySQL package, this will install MySQL in the directory /usr/local/ . Sorry but this bit need the terminal people so open it up. Do the following :
- Goto to where it lives
cd /usr/local - Go to the old install so for example on my machine :
cd mysql-standard-5.0.25-osx10.4-powerpc - All you will see in here is a directory called “data”. Copy this to the new install. (The install package puts a symbolic link in the main dir to the latest MySQL install so this makes life easy.)
cp -r data /usr/local/mysql/
if you have problems use
sudo cp -r data /usr/local/mysql/
now your new version has all your databases and settings you need to set them up or you will just getting errors when starting MySQL. - Ok navigate the current MySQL install
cd /usr/local/mysql
Now we need to set permissions for the data file for it to work. Type the following.
sudo chown -R mysql data/
Enter you password and you should be done. - Now you start your new version and test all is well. If all is well you can now trash the old install directory and also the old install package receipt found in /Library/Receipts
I wrote this of the top of my head so let me know if you have a problem.
Leave a Comment