Skip to content

Instantly share code, notes, and snippets.

@nsantorello
Created February 8, 2017 22:15
Show Gist options
  • Save nsantorello/bf9a6e30ba0bc068c30ae820e4ca06cd to your computer and use it in GitHub Desktop.
Save nsantorello/bf9a6e30ba0bc068c30ae820e4ca06cd to your computer and use it in GitHub Desktop.
Creating Seed Data with Mockeroo
delete from MyTable;
insert into MyTable (id, name) values (1, "some name");
... etc...
DeleteTables.sql
MyTable.sql
MYSQL_USERNAME="your username here!"
MYSQL_DATABASE="your database here!"
cat ScriptOrder.txt | awk '{ print "source",$0 }' | mysql --batch --default-character-set=utf8mb4 --one-database -u $MYSQL_USERNAME -p $MYSQL_DATABASE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment