summaryrefslogtreecommitdiffstats
path: root/contrib/secbugstats/bin/repairtables.sh
blob: 147669dda69a583a6c3ad5a30e807d8bb34b9561 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash
# You can manually run this script if you start getting MySQL errors about
# a table being corrupt.  This will preserve the data in your tables.

# scripts location (where does this config file live?)
SCRIPTS_DIR="$(dirname "$(readlink /proc/$$/fd/255)")"
source $SCRIPTS_DIR/settings.cfg

echo "repair table BugHistory;" | mysql -h$DB_HOST $DB_NAME -u$DB_USER -p$DB_PASS
echo "repair table Bugs;" | mysql -h$DB_HOST $DB_NAME -u$DB_USER -p$DB_PASS
echo "repair table Details;" | mysql -h$DB_HOST $DB_NAME -u$DB_USER -p$DB_PASS
echo "repair table Stats;" | mysql -h$DB_HOST $DB_NAME -u$DB_USER -p$DB_PASS