The script below intends to analyze the table in MySQL database. Besides that, it will also optimize and runs a repair check on the table. You may put the script as below as an .sh file.
mysqlcheck -o $db -u $user -p $pass
mysqlcheck -a $db -u $user -p $pass
#mysqlcheck -r $db -u $user -p $pass
Next» Backup Script For Linux-Apache-PHP-MySQL