Created
March 15, 2013 22:09
-
-
Save Swader/5173460 to your computer and use it in GitHub Desktop.
How to import multiple SQL files for separate databases at once from terminal, if those files are named after the database (with an optional prefix / suffix). Just alias it, and change the file format for your own. Taken from http://stackoverflow.com/questions/4708013/import-multiple-sql-dump-files-into-mysql-database-from-shell/12481305
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
for SQL in *.sql; do DB=${SQL/\.sql/}; echo importing $DB; mysql $DB < $SQL; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment