Skip to content

Instantly share code, notes, and snippets.

@xianhuazhou
Created November 9, 2011 11:48
Show Gist options
  • Select an option

  • Save xianhuazhou/1351213 to your computer and use it in GitHub Desktop.

Select an option

Save xianhuazhou/1351213 to your computer and use it in GitHub Desktop.
require 'mysql'
db = Mysql.new('webdb', 'root', 'pa$$', 'home')
db.query("SHOW TABLES LIKE '%home%'").each do |row|
tb_status = db.query("CHECK TABLE #{row[0]}").fetch_row
puts tb_status.join("\t")
end
db.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment