-
-
Save yoku0825/5317427 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
CMDNAME=$0 | |
if [ $# -le 0 ] ;then | |
echo "Usage: $CMDNAME database database ..." | |
fi | |
shift `expr $OPTIND - 1` | |
for database in $@ ;do | |
tables=`mysql -uroot information_schema -sse "SELECT table_name FROM tables WHERE table_schema = '$database' AND engine = 'MyISAM'"` | |
for table in $tables ;do | |
echo "`date` LOAD INDEX INTO CACHE $table" | |
mysql -uroot $database -e "LOAD INDEX INTO CACHE $table" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment