Hi guys, I am having some difficulties with mysql
I have rails working and activerecord works, and I can create
webapps that display and update databases just fine.
However, I am not using rails. I just want to do some simple
inserts to a database.
So, I tried something like the following:
@db = Mysql.new(hostname, username, password, databasename)
db.query(“insert into sent mail (id, recip, subject,spam)
Mysql::Error: Lost connection to MySQL server during query
read' from /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/vendor/mysql.rb:499:inread’
read_query_result' from /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/vendor/mysql.rb:180:inreal_query’
I then tried downloading and installing mysql-ruby-2.7
I have mysql-client installed and I ran test.rb connecting to a mysql-4
server and got the following
<> expected but was
Mysql::Error: Out of memory (Needed 2063600648 bytes)
<[nil, “hoge”, #<Mysql::Time:2005-07-19 23:53:00>]> expected but was
<[nil, “\001”, #<Mysql::Time:0000-00-00 00:00:00>]>.
<""> expected but was
So THEN, I tried ruby-mysql-0.2.6. This actually works just fine
against my mysql 4 server, but
when I run it against mysql 5, I get the following:
connect…/mysql.rb:453:in `read’: Client does not support
authentication protocol requested by server; consider upgrading MySQL
So I am out of luck if I want to use mysql 5. However my rails apps
work with a mysql5 server.
Anyone have any idea what I should be doing?
I’d appreciate assistance as I am quite muddled after all of this… I
haven’t even looked at Ruby-DBI yet!