general and slow query logging

set global slow_query_log_file = '/var/lib/mysql/slow_queries.log';
SET GLOBAL slow_query_log = 'ON';
set global long_query_time = 1;
set global log_output = '/var/lib/mysql/general.log';
set global log_output = 'FILE';
SET global general_log_file='/var/lib/mysql/general.log';
SET global general_log = 1;
SET global general_log = 0;

convert ip to int easily
select ip, ipid from ip where INET_NTOA(ip) = ('104.28.0.93')

show mysql users and their hosts
SELECT User,Host FROM mysql.user

Example insert
INSERT INTO records ( id, name, ttl, priority, content, type ) VALUES ('$domain_id','$hostname','$ttl','$priority','$content','$type')

MyISAMchk (stop mysql first)
myisamchk -fce /var/lib/mysql/$db/$table.MYI

Pull a single table from dump
awk 'BEGIN{RS="\n\n"; tableNameVar="tablenamegoeshere"} $3 ~tableNameVar || $5 ~tableNameVar{print $0}' /path/to/sql/file.sql