Topic: MySQL errors after upgrading to MySQL 5

Hi!

I decided to upgrade my local MySQL version yesterday, to the latest stable (5.0.22). It works just fine with phpmyadmin (after some work), but when I try to view a Rails project, I get this:

Mysql::Error in ArticleController#index

Client does not support authentication protocol requested by server; consider upgrading MySQL client

/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/mysql_adapter.rb:331:in `real_connect'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/mysql_adapter.rb:331:in `connect'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/mysql_adapter.rb:88:in `initialize'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/mysql_adapter.rb:37:in `mysql_connection'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:251:in `connection_without_query_cache='
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/query_cache.rb:54:in `connection='
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:220:in `retrieve_connection'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in `connection'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:1046:in `add_limit!'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:1017:in `construct_finder_sql'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:924:in `find_every'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:381:in `find'


I have updated Gems, and Rails (--with dependencies), but still no luck. Thankful for any pointers!

Re: MySQL errors after upgrading to MySQL 5

What version of MySQL did you have installed before?

Basically, your problem is that the old version of MySQL you had installed uses a different password hashing system than the version you upgraded to.

Fixes for this are detailed on this page at mysql.com smile

vinnie - rails forum admin

Re: MySQL errors after upgrading to MySQL 5

Ok, I think I get it. So is there a way to update Rails to use the new libraries, or should I create a new user for my Rails apps, and use the old_password function for that? Wouldn't that interfer with newer apps using the most recent libraries?

Re: MySQL errors after upgrading to MySQL 5

There are a bunch more possible solutions on the Rails wiki as well.

Have you tried installing the MySQL gem?

gem install mysql

vinnie - rails forum admin

Re: MySQL errors after upgrading to MySQL 5

Ahh, finally!

This did the trick:

sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

Thanx Vinnie!