Skip to content

Instantly share code, notes, and snippets.

@harrypujols
Last active May 10, 2016 14:25
Show Gist options
  • Save harrypujols/6711040dd3ef7d3debffcafad58a16a9 to your computer and use it in GitHub Desktop.
Save harrypujols/6711040dd3ef7d3debffcafad58a16a9 to your computer and use it in GitHub Desktop.
A little Ruby geanie script to import a sql file to the MAMP sql instance
puts "Hello, which database you want the file in?"
database = gets.chomp
puts "Where's the file you want to put in the database?"
filepath = gets.chomp
puts "Executing below line, please wait..."
puts ""
puts "/applications/MAMP/library/bin/mysql -u root -p #{database} < #{filepath}"
puts ""
exec '/applications/MAMP/library/bin/mysql -u root -p #{database} < #{filepath}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment