my = Mysql.new('localhost','userid','passwd','dbname')
res = my.query("INSERT INTO tbl (f1,f2,f3) VALUES(1,1,1)")
これでINSERTしようとすると、
/usr/local/lib/ruby/gems/1.8/gems/ruby-mysql-2.9.3/lib/mysql/protocol.rb:569:in `read': invalid packet: sequence number mismatch(3 != 1(expected)) (Mysql::ProtocolError)
from /usr/local/lib/ruby/1.8/timeout.rb:53:in `timeout'
from /usr/local/lib/ruby/gems/1.8/gems/ruby-mysql-2.9.3/lib/mysql/protocol.rb:565:in `read'
from /usr/local/lib/ruby/gems/1.8/gems/ruby-mysql-2.9.3/lib/mysql/protocol.rb:287:in `get_result'
from /usr/local/lib/ruby/gems/1.8/gems/ruby-mysql-2.9.3/lib/mysql/protocol.rb:275:in `query_command'
from /usr/local/lib/ruby/gems/1.8/gems/ruby-mysql-2.9.3/lib/mysql.rb:319:in `query'
from test.rb:(res = の行番号)
というエラーがでて完全にお手上げです。どうするべきでしょうか?
ruby-mysql 2.9.3
ruby 1.8.7
mysql 5.0.77
http://yakinikunotare.boo.jp/orebase/index.php?Ruby%2FMySQL%A4%C...
パッチをあてないと駄目なのでは?
そのままでは認証で失敗するので、接続できなくて
タイムアウト。
http://www.srcw.net/2010/05/27/rubymysql%E3%81%A7uninitialized-constant-mysqlprotocolunixsocket-nameerror/
my = Mysql.new('127.0.0.1','userid','passwd','dbname')
で接続してみて