Skip to content

Instantly share code, notes, and snippets.

@dotmh
Created August 26, 2011 12:09
Show Gist options
  • Save dotmh/1173285 to your computer and use it in GitHub Desktop.
Save dotmh/1173285 to your computer and use it in GitHub Desktop.
Simple Mysql2 gem install checker
require 'mysql2'
client = Mysql2::Client.new(:host => "127.0.0.1", :username => "root" , :password => "root")
results = client.query("show Databases;")
puts "found #{results.count} databases \n"
results.each do | row |
puts row["Database"]
end
puts "\n Script Finished!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment