From d53b34e403ca62dbc7c515e94110db9b602f16a8 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 22 Sep 2008 15:58:24 -0400 Subject: [PATCH] clear and rebuild db scripts darcs-hash:20080922195824-5ed1f-f95ae048209e44e4de7698d98eb8a01121a2231d.gz --- scripts/cleardb.sh | 11 +++++++++++ scripts/rebuilddb.sh | 14 ++++++++++++++ 2 files changed, 25 insertions(+) create mode 100755 scripts/cleardb.sh create mode 100755 scripts/rebuilddb.sh diff --git a/scripts/cleardb.sh b/scripts/cleardb.sh new file mode 100755 index 0000000000..06690ed70a --- /dev/null +++ b/scripts/cleardb.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +export user=$1 +export password=$2 +export DB=$3 +export SCR=$4 + +mysqladmin -u $user --password=$password -f drop $DB +mysqladmin -u $user --password=$password create $DB +mysql -u $user --password=$password $DB < $SCR + diff --git a/scripts/rebuilddb.sh b/scripts/rebuilddb.sh new file mode 100755 index 0000000000..89bc6e252d --- /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 + + -- 2.39.5