Got a link going to a local DB now i want to move this to a remote
server.
how do I go about this.

the current code is this...

    @db = Sequel::connect(:adapter => 'mysql', :host =>
'localhost', :database => 'adb', :user => 'user', :password =>
'password')


     rescue DBI::DatabaseError => e
       @log.debug("An error occurred\nError code: #{e.err}\nError
message: #{e.errstr}")

     ensure
       @log.debug('DB closed!')
       @db.disconnect if @db

all the above works as is and I'm happy with it.

So to connect to a remote DB directly I've done this....

    @db = Sequel::connect(:adapter => 'mysql', :host =>
'happy.com', :database => 'happy_test', :user =>
'happy_user', :password => 'happy_password')


     rescue DBI::DatabaseError => e
       @log.debug("An error occurred\nError code: #{e.err}\nError
message: #{e.errstr}")

     ensure
       @log.debug('DB closed!')
       @db.disconnect if @db


So I've changed the connection line and when run i get this error...
     sequel1.rb:20:in `initialize': uninitialized constant Dopen::DBI
(NameError)

So I comment out the rescue DBI line, the ensure line and disconnect
line re run the program and get this error...
/usr/lib/ruby/1.8/sequel/adapters/mysql.rb:101:in `real_connect':
Mysql::Error: Access denied for user 'db_user'@'MY STATIC IP and ISP
providers name' (using password: YES)
(Sequel::DatabaseConnectionError)
        from /usr/lib/ruby/1.8/sequel/adapters/mysql.rb:101:in
`connect'
        from /usr/lib/ruby/1.8/sequel/database.rb:93

Lots more stuff but believe what I am showing is the most critical.

the remote service has the databases predefined with my site name eg
if it was happy.com then the databases would be happy_databaseName
here and the user name would be the same happy_username.

I did do a post on the ruby forums last night but found out that as
I'm access the DB directly (not using a web interface) how can I sort
this issue out?

rgds,

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.

Reply via email to