Optimize WordPress Database Daily Using Linux Crontab
A simple method to make auto-optimization to your web application/WordPress database.
As described Here we can crontab the following mysqlcheck
command.
0 0 * * * /usr/bin/mysqlcheck -uUSER -pPASSWORD --auto-repair --optimize DataBaseName > /dev/null 2>&1
As its will run every day at the midnight.