With many database based websites, it is quite possible that at some point in time, a table on the db gets corrupted and requires a manual intervention. When such a case arises, a sql professional should handle the database recovery & repair process but if you are not willing to hire a SQL developer to repair the database, then you need to handle the repair in a proper sequence to avoid any disaster.
First of all, we need to run backups. If its a mySQL, try to export the database using PHPmyadmin. Its not guaranteed to work but it like a first aid, you need to try it no matter what. Recovery is only possible if all backups are in place. If that works, we are good, otherwise lets move to next way to backup. You will first need to find your mySQL directory where all the databases are being stored. On a cPanel server, the raw mysql files are stored at /var/lib/mysql location. Lets take a backup of all the files at this location. Being a broken database, it may not be considered a good backup and restoring it may require some professional to jump in for recovery, but nonetheless, atleast there will be a backup in case we mess up while performing the repair. Also, lets try to run the following command from terminal / ssh which will also try to create a backup of the broken database.
mysqldump -u dbuser -p dbname > dbexport.sql
While running the above query on terminal, replace the databse username and database name for the query to run successfully.
If you were successful with backing up your db using any of the above three ways, we can move ahead with the repair work otherwise, moving ahead is not advised.
Next step is to make sure that the broken database is not locked, for this, we will need to disable the website that is currently using the database by putting it in maintenance mode. Once done, we will try to restart the mysqld service, which will increase the probability of recovery. Once mysql service has been restarted, open phpmyadmin and load the tables. Select all tables or click CHECK ALL option at the end of the tables and click on repair table option from the dropdown select box. Once the task is completed, it may show the success or failure message for each table. If there is an error thrown for any of the table and the repair failed, we would suggest to get a professional mySQL support team involved that can help you with the db repair.