From: ghorner Date: 2010-04-27T05:55:08+09:00 Subject: Re: connect mysql:show tables >    require "mysql" >    dbh = Mysql.real_connect("localhost", "root", "******", "valuation") >    res = dbh.query("show tables") > - puts  res > + rows = [] > + puts "Tables_in_valutation" > + res.each {|x| p x.to_s; rows<    res.free You can take this one step further to actually print a table with hirb, http://github.com/cldwalker/hirb: require "mysql" dbh = Mysql.real_connect("localhost", "root", "******", "valuation") res = dbh.query("show tables") rows = [] res.each {|e| rows << e } puts Hirb::Helpers::AutoTable.render(rows, :headers=>["Tables in valuation"]) With my own database this produces: +---------------------+ | Tables in valuation | +---------------------+ | nodes | | schema_migrations | | taggings | | tags | | trees | | urls | +---------------------+ 6 rows in set If you're interested in having irb act as a database shell, try hirb with one of the database gems listed in http://tagaholic.me/2010/03/11/hirb-and-tables-for-all.html Gabriel