No subject


Thu Nov 23 16:36:19 EST 2017


"In MyISAM tables, deleted records are maintained in a linked list and
subsequent INSERT operations reuse old record positions. To reclaim unused
space and reduce file sizes, use the OPTIMIZE TABLE statement or the
myisamchk utility to reorganise tables. "

Jason Lewis
http://www.packetnexus.com
It's not secure "Because they told me it was secure".
The people at the other end of the link know less
about security than you do. And that's scary.





#!/bin/sh
#  optall.sh
#  Account used must have access to all databases and tables.

clear
echo ""
echo "#########################################################"
echo ""
echo "This script will optimize ALL tables that are type MYISAM"
echo "                  Use at your own risk!"
echo ""
echo "#########################################################"
echo ""

sleep 5


userid=root
password=password

echo -n "Enter the db user [$userid]: "
read TMP
if [ $TMP ]; then
    userid=$TMP
fi

echo -n "Enter the db user password [$password]: "
read TMP1
if [ $TMP1 ]; then
        password=$TMP1
fi


getdb="/usr/local/bin/mysql -u${userid} -p${password}"

$getdb -e 'SHOW DATABASES' | sed 's/|//g' | grep -v 'Database' \
 | while read dbname; do
        echo "Optimizing db ${dbname}"
        gettables="/usr/local/bin/mysql -u${userid} -p${password} ${dbname}"
                $gettables -e 'SHOW TABLES' | sed 's/|//g' | grep -v
'Tables' \
                 | while read table; do
                        echo "Optimizing table ${table}"
                        echo "OPTIMIZE TABLE ${table};"|$gettables
                done

done





More information about the Snort-users mailing list