Rails mysql db connection problem


#1

Hello,
I have encountered a weird problem while trying to use a db driven rails test app.
Here is the error message from production.log:

Mysql::Error (Access denied for user ‘root’@‘popcorn.dreamhost.com’ (using passw
ord: YES))

Some metadata:

  • database.yml is correct (double checked)
  • I can connect the db from irb (require ‘mysql’; Mysql.real_connect(…))
  • I can run this simple script:

#!/usr/bin/env ruby
require 'rubygems’
require ‘active_record’

ActiveRecord::Base.establish_connection(
:adapter => “mysql”,
:host => “monb.way2web2.biz”,
:username => “whatever”,
:password => “yourwelcome”,
:database => “testapp”)

class Item < ActiveRecord::Base

def initialize name
puts "init"
super
self.name=name
end

end

item=Item.new :name=>'item’
p item.id
p item.name

item.save

  • changing production db to sqlite3 works
  • web server is popcorn, db is on bastet:santa.

Any ideas? Any hint is welcome.
Thank you in advance,
Giorgi