Manual active record db connection in ruby using mysql adapter

Here is the code to make manual connection with database require 'active_record'ActiveRecord::Base.establish_connection( :adapter => "mysql", :host => "localhost", :username => "root", :password => "abcd", :database => "funonrails" )Load database configurations from yml file dbconfig = YAML::load(File.open('database.yml'))ActiveRecord::Base.establish_connection( dbconfig )