Skip to content

Instantly share code, notes, and snippets.

@arthurnn
Created May 17, 2016 19:21
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 arthurnn/2c2e8a4c5a2f15ab1f79acc5bc13dcfe to your computer and use it in GitHub Desktop.
Save arthurnn/2c2e8a4c5a2f15ab1f79acc5bc13dcfe to your computer and use it in GitHub Desktop.
require 'mysql2'
connection = Mysql2::Client.new(host: "127.0.0.1", port: 3306, username: "root", database: "test")
connection.automatic_close = false
p connection.query( "SELECT database();" ).to_a
fork { }
Process.wait
p connection.query( "SELECT database();" ).to_a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment