summaryrefslogtreecommitdiff
path: root/scripts/rebuilddb.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/rebuilddb.sh')
-rwxr-xr-xscripts/rebuilddb.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/rebuilddb.sh b/scripts/rebuilddb.sh
new file mode 100755
index 000000000..89bc6e252
--- /dev/null
+++ b/scripts/rebuilddb.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+export user=$1
+export password=$2
+export DB=$3
+export SCR=$4
+
+mysqldump -u $user --password=$password -c -t --hex-blob $DB > /tmp/$DB.sql
+mysqladmin -u $user --password=$password -f drop $DB
+mysqladmin -u $user --password=$password create $DB
+mysql -u $user --password=$password $DB < $SCR
+mysql -u $user --password=$password $DB < /tmp/$DB.sql
+
+