clear and rebuild db scripts
darcs-hash:20080922195824-5ed1f-f95ae048209e44e4de7698d98eb8a01121a2231d.gz
This commit is contained in:
parent
e24425d44e
commit
d53b34e403
11
scripts/cleardb.sh
Executable file
11
scripts/cleardb.sh
Executable 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
14
scripts/rebuilddb.sh
Executable 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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user