require "mysql" m = Mysql.new(host, user, passwd) m.list_dbs.each do |db| puts db end
require "mysql" m = Mysql.new(host, user, passwd, db) m.list_tables.each do |table| puts table end
require "mysql" m = Mysql.new(host, user, passwd, db) m.list_fields("table").fetch_fields.each do |f| puts f.name end
require "mysql" m = Mysql.new(host, user, passwd, db) res = m.query("select * from table") fields = res.fetch_fields.filter do |f| f.name end puts fields.join("\t") res.each do |row| puts row.join("\t") end