Routing the world

Routing & IT System Administration

Archive for September 2012

MySQL diagnosis and troubleshooting

leave a comment »

To determine slow queries. We get the top 10 queries (-t 10) sorted by the number of occurrences in the log (-s c).
mysqldumpslow -s c -t 10

Search which Databases are un use based on the queries.
grep -C 1 "Data_Base_Query" mysql-slow.log | grep use | grep -v User | sort | uniq -c

Process List in MySQL Shell
mysql> show processlist;
mysql> show full processlist;

Chek and Repair Tables in All Databases
mysqlcheck -u root -p --auto-repair --check --optimize --all-databases


Written by Root

September 11, 2012 at 13:34

Posted in Linux

Tagged with , ,

%d bloggers like this: