I would like to repair + optimize my MySQL database once a week!
How could I do this?
I run these regularely, the -A option selects all databases
to run it regularely you would need a cronjob like this:
35 0 * * 1 mysqlrepair -A > /dev/null; mysqloptimize -A > /dev/null
This cronjob would run at 0:35 AM on every monday morning
If you need to authenticate, yould would use
mysqlrepair -uUSERNAME -pPASSWORD -A
mysqloptimize -uUSERNAME -pPASSWORD -A
For repair you can check auto-repair option. For optimization there is no recipe to do it automagicaly but you can try use mysqltuner.pl script and see what it suggests you should tune.
Sign up using Google
Sign up using Facebook
Sign up using Stack Exchange
2 years ago
1 year ago