Routing the world

Routing & IT System Administration

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 , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: