Recovering my mysql data on Snow Leopard

Updating to Snow Leopard broke my mysql install. Pro-tip: back up your databases before updating to Snow Leopard.

I didn’t do this. To get the data back – recreate the /usr/local/mysql -> /usr/local/mysql_versionbuilddatanumberstuff symbolic link. This gets broken in the install.

I then clobbered the /Library/LaunchDaemons mysql item, and the /Library/StartupItems one. Now mysqld will not launch by default.

Rebooted.

sudo cp /usr/local/mysql/support-files/my-small.cnf /etc/my.cnf

mysqld_safe &

Now I am able to run

mysqldump -u root -A > saved.sql

to dump the databases. Now I downloaded the Mac OS X 64 bit mysql package and run the installer then reboot.

Now load my data into the new server using

mysql -u root < saved.sql

And I'm off to the races.

Leave a Reply

You must be logged in to post a comment.