Calculate the Query cache using MySQL command: SELECT FORMAT(((QCACHE_HITS / (Qcache_hits + Qcache_inserts + Qcache_not_cached))*100),2) AS query_cache_hit_rate_percentage, QCACHE_FREE_BLOCKS, QCACHE_FREE_MEMORY, QCACHE_HITS, QCACHE_INSERTS, QCACHE_LOWMEM_PRUNES, QCACHE_NOT_CACHED, QCACHE_QUERIES_IN_CACHE, QCACHE_TOTAL_BLOCKS FROM ( SELECT MAX(IF(VARIABLE_NAME = ‘QCACHE_FREE_BLOCKS’, VARIABLE_VALUE, NULL)) QCACHE_FREE_BLOCKS, MAX(IF(`VARIABLE_NAME` = ‘QCACHE_FREE_MEMORY’, VARIABLE_VALUE, NULL)) QCACHE_FREE_MEMORY, MAX(IF(`VARIABLE_NAME` = ‘QCACHE_HITS’, VARIABLE_VALUE, NULL)) QCACHE_HITS, MAX(IF(`VARIABLE_NAME` = ‘QCACHE_INSERTS’, VARIABLE_VALUE, NULL)) QCACHE_INSERTS, MAX(IF(`VARIABLE_NAME` = ‘QCACHE_LOWMEM_PRUNES’, … Read More “Calculate Query Cache” »
Category: MySQL
MySQL, PHP
MySQL
#!/bin/bash MYSQLCMD=mysql for db in `echo show databases | $MYSQLCMD | grep -v Database`; do for table in `echo show tables | $MYSQLCMD $db | grep -v Tables_in_`; do TABLE_TYPE=`echo show create table $table | $MYSQLCMD $db | sed -e’s/.*ENGINE=\([[:alnum:]\]\+\)[[:space:]].*/\1/’|grep -v ‘Create Table’` if [ $TABLE_TYPE = “InnoDB” ] ; then mysqldump $db $table > … Read More “Script to convert InnoDB tables to MyISAM” »