Tech Support Notes

Mysql

Check and repair tables

myisamchk -r /var/lib/mysql/*/*.MYI  

Check mysql variables

  • Check for slow query log
mysqladmin var | grep slow

Grant user access to db(remote)

grant all privileges on DATABASENAME.* to 'USERNAME'@'REMOTE_IP_ADDRESS' identified by 'DATABASEPASSWORD';

Set max connection limit

SET GLOBAL max_connections = 600;  
select @@max_connections;

Show engine status

mysql -e "show engine INNODB status\G;"

Mysql Process List

 mysqladmin proc | sed -e 's/|//g' -e '/-/d' | awk '{print $2}' | sort | uniq -c | sort -nk 1

Loop to watch Mysql processlist

while true; do clear; mysql -e 'show processlist'; sleep 1; done

Mtop
Mytop
Mysql-Tuner
Mysql-Tuner How to