How do I "repair" a mysql table on my remote server ?

I tried to access my database via the “Edit Databases” in the VirtualMin
but I get this message:

SQL show index from c2s_main failed : Table ‘./guru777/c2s_main’ is marked as crashed and should be repaired

Is there a way to run a repair from VirtualMin or do I need to do this via a command line such as putty ?



I don’t believe there’s a way to do that from the Virtualmin GUI.

However, there are a few tools provided by MySQL to help you do that from the command line.

MySQL provides instructions on how to repair databases here:

Scroll down to where it says “Stage 1: Checking your tables”, and start from there. However, be sure to note the warning from the preceding paragraph, that reminds you that you need to stop MySQL before running the repairs. You can stop MySQL by running this command:

/etc/init.d/mysqld stop

Then you can step through the instructions they have in there.


Thanks for the input.

I am using putty and I stopped the mysql OK with that command.

then I typed in
myisamchk -c *.myi

After reading the instructions carefully, I thought this would check all
of the tables, but I got this reply:

File ‘*.myi’ doesn’t exist

Do I need to specify the path ?

  • I thought that it should find all the tables .



Those instructions are assuming that, as the root user, you’ve moved into the directory containing the tables you want to repair.

By default, MySQL stores it’s databases in /var/lib/mysql. So if you’re looking to repair the tables for a database named “guru777”, you’d want to “cd” into that dir by running:

cd /var/lib/mysql/guru777

And then run the myisamchk program as you did above.


Thanks very much for your help :slight_smile:

I fixed the table with the -r
and it seems to be ok now.

I registered an account on this site for the sole purpose of making a comment here. I ran into a very similar issue and andreychek’s posts were instrumental in resolving my issue. So thanks very much! I don’t care if it is 4yrs old, the people need to know.