mysql

mysql

mysql

Free swap

/etc/init.d/mysql stop
swapoff -a
swapon -a, 
/etc/init.d/mysql start

Number of connections

netstat -nupta | grep 3306 | grep ESTABLISHED | wc -l

show status like 'max_used_connections';

Load huge number of sql files

cat *.sql | mysql -u root -p xxxx

Procedures/Functions

SHOW PROCEDURE STATUS;
SHOW FUNCTION STATUS;

# To see a procedure or function

show create function xxxxxxxxx;
show create procedure xxxxxxxxx;

Check queries status

show processlist;

show processlist\G;

show full processlist;

Debug mode

Discomment #general_log=On in /etc/mysql/my.cnf

/etc/init.d/mysql restart

User permissions

show grants;

select user,host,password from mysql.user;

mysqladmin -u USER -p password NEWPASSWORD 

Check MySQL certificates configuration

# Verify in /etc/mysql/mysql.conf.d/mysqld.cnf

ssl-ca=/etc/mysql/cacert.pem
ssl-cert=/etc/mysql/server-cert.pem
ssl-key=/etc/mysql/server-key.pem

Check MySQL cipher configuration

# Verify in /etc/mysql/mysql.conf.d/mysqld.cnf

ssl-cipher=AES128+EECDH:AES128+EDH

Troubleshooting slow MySQL performance

Getting the data

Check if the MySQL slow query log is enabled.
You can find instructions on how to do this at: Enabling MySQL slow query logs
Restart MySQL.

Converting data into information

mysqldumpslow -t 10 mysql-slow-query.log > mysqldumpslow.out

Check InnoDB Status

SHOW ENGINE INNODB STATUS

Check TokuDB Status

SHOW ENGINE TokuDB STATUS

Check Global Status

SHOW GLOBAL STATUS\G