#!/bin/sh # $Id: myisam-pack-tables,v 1.1 2003/04/15 07:01:25 friedman Exp $ # Compress the data for MySQL MyISAM tablespaces. # Note that you cannot create or alter indexes on compressed tables even # though the index itself is not compressed; you must uncompress the data # first. for table in ${1+"$@"}; do case $table in *.frm | *.MYI | *.MYD ) table=`echo "$table" | sed -e 's/\.???$'` ;; esac TMPDIR=`dirname "$table"` export TMPDIR myisampack -T "$TMPDIR" "$table" || exit $? myisamchk -rq --analyze --sort-index "$table" done