Repair A MySql DB


I had to move my DB's path and forgot to shutdown the service first....BANG! corrupt DB. Heres how I fixed it


You will probably get an error like the following when starting up the mysql service:
/usr/local/libexec/mysqld: Table './databasename/tablename' is marked as crashed


To fix this (replace path/DB name with your own)


Stop the mysql service





A lot of text will appear and it will show its trying to fix it. Sometimes it cant right off the top and you need to add the -ro option



If there is a lot of corruption you can do a repair on the whole DB instead of just a table



Now once the fix(es) have been applied, the database should come up when the service is restarted: