Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- db=$1
- tables=`mysql -ss -u root -p -e "SHOW TABLES" $db`
- for i in $tables
- do
- #Check how many rows has a table
- rows=`mysql -u root -p -e "SELECT COUNT(*) FROM $i" -s $db`
- # Prepare environment
- echo "Restoring table $i"
- table=$i
- perl create_defs.pl --host=localhost --user=root --password=YOUR_PASSWORD --db=$1 --table=$table > include/table_defs.h.$table
- cd include && rm -f table_defs.h && ln -s table_defs.h.$table table_defs.h
- cd ..
- make clean all
- # Restoring rows
- found=0
- while [ $found -lt 1 ]
- do
- echo ""
- ./constraints_parser -5 -f /var/lib/mysql/ibdata1.recovery >> out.$i
- found=1
- done
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement