Skip to content

Instantly share code, notes, and snippets.

@tlongren
Forked from alexalouit/mysql-health.sh
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tlongren/415ec2a545f16b0340e8 to your computer and use it in GitHub Desktop.
Save tlongren/415ec2a545f16b0340e8 to your computer and use it in GitHub Desktop.
Check And Repair All MySQL Databases on Debian And Ubuntu Linux
#!/bin/sh
#
# cron ex: 0 0 1 * * /usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /home/tyler/mysql-health.sh >> /home/tyler/mysql-health.log
mysqlcheck --defaults-file=/etc/mysql/debian.cnf --auto-repair --optimize --all-databases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment