The ramblings of Eric Seijo - Software Developer / Life Hacker

Snow Leopard - MySQL Upgrade

Posted by Eric Seijo Tue, 01 Sep 2009 20:34:00 GMT

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.

  1. 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

  2. Run the Snow Leopard install.

  3. Download and install the 64-bit MySQL 5.1.37 from mysql.com.

  4. 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

  5. Import your data:

    mysql -u username -ppassword database_name < dump.sql

  6. Update MacPorts if needed.

  7. 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

 

Leave a comment

Comments