clear and rebuild db scripts

darcs-hash:20080922195824-5ed1f-f95ae048209e44e4de7698d98eb8a01121a2231d.gz
This commit is contained in:
Evan Prodromou 2008-09-22 15:58:24 -04:00
parent e24425d44e
commit d53b34e403
2 changed files with 25 additions and 0 deletions

11
scripts/cleardb.sh Executable file
View File

@ -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

14
scripts/rebuilddb.sh Executable file
View File

@ -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