Optimizing/Repairing MySQL databases

  Mysql

Quick cheatsheet from here – https://www.rosehosting.com/blog/optimizing-and-repairing-mysql-databases-with-mysqlcheck/

1. Check one table in the MySQL database

mysqlcheck -c database table -u root -p

2. Check ALL tables in the MySQL database

mysqlcheck -a database -u root -p

3. Optimize all tables in all MySQL database

mysqlcheck -o database -u root -p

4. Repair MySQL database

mysqlcheck -r database -u root -p

MySQLTuner

1. Download mysqltuner

wget http://mysqltuner.com/mysqltuner.pl

2. Ensure it’s executable

chmod 700 mysqltuner.pl

3. Run!

./mysqltuner.pl