ActiveRecord::Base.establish_connection( :adapter => 'mysql', :host => 'localhost', :username => 'name', :password => 'password', :database => 'db_name' )