Upgrading to MySQL 4.1 with Rails

In a Rails app, I’m using ActiveRecord::Extensions to get faster load times of a large set of records. This requires a new feature in MySQL 4.1, supporting the ‘ON DUPLICATE KEY UPDATE …’ statement. I previously had MySQL 4.0 installed (ubuntu breezy badger). Here’s what I did to update:

sudo apt-get install mysql-server-4.1 mysql-client-4.1

After that, tried to do some operation in rails, and it failed:

Mysql::Error: Lost connection to MySQL server during query: ....

That problem had a simple fix:

 sudo gem install mysql

The ruby mysql gem had to be rebuilt with the new mysql libs, then everything was peachy!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: