.:: An exploration of exercise plans, weight loss and better workouts. ::.

" Searching begets purpose.. So we keep looking for the better workout plan, the better weight loss strategy, the better version of ourselves.. "

Choose a Topic:

Fri
14
May '10

Ruby 1.8.7 Mysql::Error: Client does not support authentication protocol requested by server

Upgraded to ruby 1.8.7. Went to the script/console, executed a basic activerecord find command and received the following error :


Mysql::Error: Client does not support authentication protocol requested by server.

From the accompanying stack trace, it’s obvious that ActiveRecord is looking at the old mysql adapter that comes packaged with ruby 1.8.7.

from /usr/local/lib/ruby/1.8/mysql.rb:453:in `read'
from /usr/local/lib/ruby/1.8/mysql.rb:130:in `real_connect'
from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:589:in `connect'
from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:203:in `initialize'
from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:75:in `new'

Not sure why this is, but just decided to rename the default ruby mysql adapter and retry it :


sudo mv /usr/local/lib/ruby/1.8/mysql.rb /usr/local/lib/ruby/1.8/_mysql.rb


>> Location.find(151)
=> #, lng: #, created_at: "2010-03-02 21:07:06", updated_at: "2010-03-30 06:45:09", airport_id: 1>

Success. Not sure why Rails wasn’t choosing the installed mysql adapter (2.8.1) over the default adapter.

Start discussion »

Leave a Reply