gnu-social/scripts/rebuilddb.sh
Evan Prodromou d53b34e403 clear and rebuild db scripts
darcs-hash:20080922195824-5ed1f-f95ae048209e44e4de7698d98eb8a01121a2231d.gz
2008-09-22 15:58:24 -04:00

15 lines
360 B
Bash
Executable File

#!/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