# Ruby/sequel/mysql problem

**URL:** <https://www.ruby-forum.com/t/ruby-sequel-mysql-problem/165096>\
**Category:** Ruby\
**Created:** [April 9, 2009, 1:35am UTC](https://www.ruby-forum.com/t/ruby-sequel-mysql-problem/165096 "2009-04-09T01:35:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![df-sean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@df-sean](https://www.ruby-forum.com/u/df-sean)\
**Post date:** [April 9, 2009, 1:35am UTC](https://www.ruby-forum.com/t/ruby-sequel-mysql-problem/165096/1 "2009-04-09T01:35:52Z")

</div>

newbie here.

have ruby/sequel/sqlite and windows 2003 server working smooth.

but have problem with mysql

“gem install mysql”

run a basic ruby test script, got error popop

“this application has failed to start because LIBMYSQL.dll was not  
found. Re-installing the application may fix the problem.”

Then copy LIBMYSQL.dll from my sql/bin to ruby/bin

this fixed the problem. Basic ruby / sql connection passed.

Then try to use sequel model with my sql code as following,

DB = Sequel.mysql(db\_name, db\_user, db\_password, db\_host, db\_port)  
class Test \< Sequel::Model(:test)  
end  
tt = DB[“test”].filter(:key =\> ‘key’).first

got error:

C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/lib/sequel\_core/  
adapters/mysql.rb:149:in `query': Mysql::Error Commands out of sync; you can't run this command now (Sequel::DatabaseError) from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/ lib/sequel_core/adapters/mysql.rb:149:in`\_execute’  
from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/  
lib/sequel\_core/adapters/mysql.rb:108:in `execute' from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/ lib/sequel_core/connection_pool.rb:109:in`hold’  
from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/  
lib/sequel\_core/database.rb:440:in `synchronize' from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/ lib/sequel_core/adapters/mysql.rb:108:in`execute’  
from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/  
lib/sequel\_core/dataset.rb:477:in `execute' from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/ lib/sequel_core/adapters/mysql.rb:343:in`execute’  
from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/  
lib/sequel\_core/adapters/mysql.rb:285:in `fetch_rows' from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/ lib/sequel_core/dataset.rb:462:in`\_each’  
from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/  
lib/sequel\_core/dataset.rb:213:in `each' from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/ lib/sequel_core/dataset/convenience.rb:181:in`singl  
e\_record’  
from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/  
lib/sequel\_core/dataset/convenience.rb:52:in `first’  
from main.rb:137

connection looks ok but error on the filter().first same code works  
for sqlite.

Any idea?

Appreciate.  
Sean

---

<div class="post-metadata">

**Author:** ![df-sean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@df-sean](https://www.ruby-forum.com/u/df-sean)\
**Post date:** [April 9, 2009, 4:57pm UTC](https://www.ruby-forum.com/t/ruby-sequel-mysql-problem/165096/2 "2009-04-09T16:57:05Z")

</div>

Sean Sean wrote:

> newbie here.
> 
> have ruby/sequel/sqlite and windows 2003 server working smooth.
> 
> …

See the sequel-talk thread:  
[http://groups.google.com/group/sequel-talk/browse\_thread/thread/f0ab21612f3e1fa3](http://groups.google.com/group/sequel-talk/browse_thread/thread/f0ab21612f3e1fa3)
