summaryrefslogtreecommitdiff
path: root/scripts/make-empty-db
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/make-empty-db')
-rwxr-xr-xscripts/make-empty-db24
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/make-empty-db b/scripts/make-empty-db
new file mode 100755
index 0000000..7157539
--- /dev/null
+++ b/scripts/make-empty-db
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+export SCRIPTDIR=/home/andi/muggle/import
+cd $SCRIPTDIR
+
+echo "creating db"
+mysql < createdb.mysql
+
+echo "creating tables"
+mysql < $SCRIPTDIR/createtables.mysql
+
+echo "reading genres"
+echo " use GiantDisc; load data local infile '$SCRIPTDIR/genres.txt' into table genre;"| mysql --local-infile=1
+
+
+echo "reading languages"
+echo "use GiantDisc; load data local infile '$SCRIPTDIR/languages.txt' into table language;" | mysql --local-infile=1
+
+echo "reading musictypes"
+echo "use GiantDisc; load data local infile '$SCRIPTDIR/musictypes.txt' into table language;" | mysql --local-infile=1
+
+
+echo "reading sources"
+echo "use GiantDisc; load data local infile '$SCRIPTDIR/sources.txt' into table language;" | mysql --local-infile=1