summaryrefslogtreecommitdiff
path: root/_darcs/pristine/scripts/rebuilddb.sh
blob: 89bc6e252de86706533e9395b72abfcfdd10040d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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