Skip to content

Instantly share code, notes, and snippets.

@stevebooks
Created July 31, 2013 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevebooks/6125321 to your computer and use it in GitHub Desktop.
Save stevebooks/6125321 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
require 'mysql'
begin
con = Mysql.new 'localhost', 'user12', '34klq*'
puts con.get_server_info
rs = con.query 'SELECT VERSION()'
puts rs.fetch_row
rescue Mysql::Error => e
puts e.errno
puts e.error
ensure
con.close if con
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment