Last active
December 15, 2015 18:49
-
-
Save doublemarket/5306525 to your computer and use it in GitHub Desktop.
データベース名を引数に渡すと、そのデータベース内のテーブルのインデックスをkey_bufferに読み込むシェルスクリプト。
MyISAMのテーブルでしか使えません。
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 $database -N -e 'show tables'` | |
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