Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to repair a MySQL table without using phpMyAdmin?

I had a table with complicated columns, I started to fill it with a heavy data, during that, it crashed.

table reported as crashed and need to be repaired.

Repair Table in phpmyadmin could not repair it.

Then I decided to start filling process again, but I even could not retrieve table structure.

How can I get data back? Or just structure?

(i run mysql under xampp/windows on a amd quad)

like image 929
Alexar Avatar asked Dec 07 '22 04:12

Alexar


1 Answers

PHPMyadmin tends to have problems when executing long queries. If it failed to do the repair table with a specific error message, please post it. If it just hung, you shoul try the repair by using the command line version of mysql, it's located in the bin directory of your mysql installation.

mysql -u username -p
mysql> use dbname;
mysql> repair table tablename;

depending on the size of the table, this could take A while.

If that doesn't work, your next move is to use myisamchk if your table uses the MyISAM engine.

like image 199
Mike Sherov Avatar answered Dec 09 '22 17:12

Mike Sherov