I am unsure of what i'm doing wrong but it seems that it's 1 step
forward and a few back at present for me.
after issues trying to sort out the rescue ensure part of my DB access
script i've fallen foul of the gem gods again.
my connection code is this...
puts 'in remote side'
@db = Sequel.mysql2(:host => 'remote.co.nz', :database =>
'server', :user => "my_name", :password => "2010")
# remote
end
Thread.new{loop{sleep 60; DB.get(1)}} #to keep the connection
open
rescue Sequel::DatabaseError
@log.debug("An error occurred\nError code: #{Sequel}\nError
message: #{Sequel.to_s}")
ensure
@log.debug("DB closed!")
@db.disconnect if @db
currently i am getting these errors...
in DB connection initialize
in remote side
C:/Ruby187/lib/ruby/gems/1.8/gems/sequel-3.18.0/lib/sequel/adapters/
mysql2.rb:58
:in `query': Interrupt: (Sequel::DatabaseConnectionError)
from C:/Ruby187/lib/ruby/gems/1.8/gems/sequel-3.18.0/lib/
sequel/adapters
/mysql2.rb:58:in `connect'
this ot me *IS* the problem!
**** lots of lines referring to problems in the apdapter - these
not shown.****
I tried originially this line and got the same errors
@db = Sequel.connect(:adapter => 'mysql', :host =>
'remote.co.nz', :database => 'server', :user => "my_name", :password
=> "2010")
I've also tried a simple get the version number after the connect and
it has worked but as soon as i try to get a Query result this error
occures
I am wondering if the mysql (2.8.1 x86-mingw32) gem is incompatible
with sequel.
tried using mysql2 (0.2.6 x86-mingw32) also but this too gives me the
same errors.
Now just added a .connect and got this error so I'm making progress
but don't understand what I am doing wrong!
connection statement was
@db = Sequel.mysql.connect(:host => 'remote.co.nz', :database =>
'server', :user => "my_name", :password => "2010")
in DB connection initialize
in remote side
C:/Ruby187/lib/ruby/gems/1.8/gems/sequel-3.18.0/lib/sequel/adapters/
mysql.rb:112
:in `real_connect': Access denied for user 'dave'@'localhost' (using
password: N
O) (Mysql::Error)
from C:/Ruby187/lib/ruby/gems/1.8/gems/sequel-3.18.0/lib/
sequel/adapters
/mysql.rb:112:in `connect'
from sequel1.rb:20:in `initialize'
from sequel1.rb:163:in `new'
from sequel1.rb:163
I don't care which adapter I use - MYSQL or MYSQL2 as long as i can
connect, query update add etc data as i need to.
all help appreciated.
dave.
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en.