[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby - mysql - Error Authentication protocol not supported

jsp408

7/8/2006 11:58:00 PM

On Windows XP Prof system, using Ruby 1.8.4 & mysql-ruby-2.7.1 (pure
ruby interface),
myswl 5.0 server, and rubyuser is defined as a mysql user, I am trying
to run the following sample program and getting the error:

*** C:/ruby/lib/ruby/1.8/mysql.rb:453:in `read': Client does not
support authentication protocol requested by server; consider
upgrading MySQL client (Mysql::Error)
from C:/ruby/lib/ruby/1.8/mysql.rb:130:in `real_connect'
from C:/ruby/lib/ruby/1.8/mysql.rb:91:in `initialize'
from C:/0-dwn/mysql/ruby-mysql-0.2.6/sampledb0.rb:5


I am able to perform all of the commands via a commandline console.

Please help me with this error message, what do I need to change to get
it working

Thanks,
John

========Sampledb.rb =========================================

require "mysql"

dbname = "sampledb"

m = Mysql.new("localhost", "root", "passwd")
r = m.query("CREATE DATABASE #{dbname}")
m.select_db(dbname)
m.query("CREATE TABLE words
(
german varchar(30),
english varchar(30),
french varchar(30)
)"
)

m.query("INSERT INTO words VALUES('Adler', 'eagle', 'aigle')")
m.query("INSERT INTO words VALUES('Haus', 'house', 'maison')")
m.query("INSERT INTO words VALUES('Name', 'name', 'nom')")
m.query("INSERT INTO words VALUES('Wal', 'whale', 'baleine')")
m.query("GRANT ALL ON sampledb.* TO rubyuser@localhost IDENTIFIED by
'ruby'")

m.close
================================================

2 Answers

Justin Collins

7/10/2006 5:51:00 PM

0

jsp408@comcast.net wrote:
> On Windows XP Prof system, using Ruby 1.8.4 & mysql-ruby-2.7.1 (pure
> ruby interface),
> myswl 5.0 server, and rubyuser is defined as a mysql user, I am trying
> to run the following sample program and getting the error:
>
> *** C:/ruby/lib/ruby/1.8/mysql.rb:453:in `read': Client does not
> support authentication protocol requested by server; consider
> upgrading MySQL client (Mysql::Error)
> from C:/ruby/lib/ruby/1.8/mysql.rb:130:in `real_connect'
> from C:/ruby/lib/ruby/1.8/mysql.rb:91:in `initialize'
> from C:/0-dwn/mysql/ruby-mysql-0.2.6/sampledb0.rb:5
>
>
> I am able to perform all of the commands via a commandline console.
>
> Please help me with this error message, what do I need to change to get
> it working
>
> Thanks,
> John
>
> [snip]
>
I think I heard that the ruby mysql library doesn't work with mysql 5?
I'm not sure, though.

-Justin

Andrew RJ

7/11/2006 6:21:00 AM

0

Justin Collins wrote:
> jsp408@comcast.net wrote:
>> from C:/0-dwn/mysql/ruby-mysql-0.2.6/sampledb0.rb:5
>> [snip]
>>
> I think I heard that the ruby mysql library doesn't work with mysql 5?
> I'm not sure, though.

MySQL/Ruby works fine with MySQL 5.0.* (for me, 5.0.19):
http://www.tmtm.org/en/m...
- This is great if you can do makes.
- Been using this for years, with various MySQLs.
- Tomita Masahiro keeps it up to date still, last was just over 1
month ago.

His Ruby/MySQL doesn't seem to (and is the rumour source I suspect):
http://www.tmtm.org/en/r...
- however, maybe you can, if you use the old authentication protocol
(see 1st paragraph here:
http://www.tmtm.org/ja/ruby/mysql/R...)
- Latest version is out-of-date, and is around 1.5 years old.
- Also, it is decently slower (unsurprising, shush).

The rails-emergent ActiveRecord can use either of these, but as it says,
the pure ruby one won't work with MySQL 4.1.*+ ... but the natively
linked one will.
http://wiki.rubyonrails.org/rails/p...

Maybe useful, maybe not.
ARJ


--
Posted via http://www.ruby-....