1. Copy One database to other on same hostmysqldump -uroot -p source_database_name | mysql -uroot dest_database_name2. Copy database from one host to other host.mysqldump -uroot -p source_database | ssh host2 "mysql -uroot dest_database"
Tag: mysql
Mysql cheatsheet
Change Mysql password mysqladmin -u root -p'oldpassword' password newpass
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 )