Snow Leopard - MySQL Upgrade
I just upgraded my main production Mac to Snow Leopard and when I sat down to work today I noticed that I was unable to access the local MySQL instance. After doing some research I found that it is probably best to seize the moment and upgrade to the 64bit version.
There were some tricky things I encountered along the way so I thought I would share in hopes of making someone else's life easier.
- Before you upgrade backup any of your databases:
mysqldump -u username -ppassword database_name > dump.sql
Or, if you want to backup all databases use:
mysqldump -u username -ppassword –all-databases > dump.sql
- Run the Snow Leopard install.
- Download and install the 64-bit MySQL 5.1.37 from mysql.com.
- For Ruby on Rails run the following commands to update your gems:
sudo gem update --system
sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
- Import your data:
mysql -u username -ppassword database_name < dump.sql
- Update MacPorts if needed.
- Update your gems.
You should be up and running.
References:
http://gist.github.com/177368
http://stackoverflow.com/questions/991708/rails-mysql-and-snow-leopard