From: Thufir Date: 2009-11-17T02:30:06+09:00 Subject: Re: Using activerecord with mysql Could still be a db problem. You don't have to use yml, try something like: thufir@ARRAKIS:~/projects/rss2mysql$ thufir@ARRAKIS:~/projects/rss2mysql$ nl mysql.rb 1 require 'rubygems' 2 require 'activerecord' 3 require 'pp' 4 ActiveRecord::Base.establish_connection( 5 :adapter => 'mysql', 6 :host => '127.0.0.1', 7 :username => 'ruby', 8 :password => 'password', 9 :database => 'rss2mysql') 10 class Item < ActiveRecord::Base 11 has_one :page 12 end 13 items = Item.find(:all) 14 items.each do |item| 15 pp item.url 16 end thufir@ARRAKIS:~/projects/rss2mysql$ Of course, modify for your configuration. At first, I thought maybe mysql wasn't installed/running properly for you, but it does appear to be working. you can always log into mysql and manually create the db and populate a table with data, then query from ruby. From mysql, can you describe the table? HTH, Thufir