Last active
May 10, 2016 14:25
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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