0 příspěvků / 0 new
Nes
Obrázek uživatele Nes
Offline
Naposledy viděn: 14 let 4 měsíce zpět
Připojen: 07.01.2007 - 05:33
Optimalizace databaze - mam navod - potrebuji poradit

nasel jsem nize uvedeny navod na optimalizaci, kterou pry nutne potrebuji- bohuzel absolutne nevim co s tim mam delat - muzete prosim poradit? Dekuji

another thing is, that if you have MyISAM engine, you will need to transform it to InnoDB (which is much more faster). Its why i made another script:

#!/bin/sh
DBNAME=$2;
USER="root";
PASSWORD="password";

printUsage() {
echo "Usage: $0"
echo " --alter "
return
}

check_all_tables() {
TABLENAMES=`mysql -u $USER -p$PASSWORD -D $DBNAME -e "SHOW TABLES\G;"|grep 'Tables_in_'|sed -n 's/.*Tables_in_.*: \([_0-9A-Za-z]*\).*/\1/p'`

for TABLENAME in $TABLENAMES
do
mysql -u $USER -p$PASSWORD -D $DBNAME -e "ALTER TABLE $TABLENAME ENGINE = InnoDB;"
done
}

if [ $# -eq 0 ]; then
printUsage
exit 1
fi

case $1 in
--alter) check_all_tables;;
--help) printUsage; exit 1;;
*) printUsage; exit 1;;
esac

Pod tim bylo napsanio:

To use it, just save it into shell script, like "db_alter.sh," make it executable (chmod +x db_alter.sh), and then run:
./db_alter.sh --alter mangos
(make this for all your databases, like forum, website, or realmd, it really encrease your q/s speed)