Q) How can I mass optimize repair & optimize on my MySQL databases?
A) open SSH and connect to your server.
Run the following command:
mysqlcheck -u root -p --auto-repair --optimize --all-databases
it will ask you for your MySQL root password, if you do not know this then Login to WHM as root user, on the left type MySQL and click MySQL Root password. Enter a new password and save.
Don't worry this won't break anything!
then go back to SSH and try again.