Sign in to follow this  
Followers 0
rakshit

Mysql table got corrupted? how to re structure them

7 posts in this topic

I was Updating my Mysql Tables using PHPmyadmin, But due to some software corruption in the PHPmyadmin , One of my tables got corrupted. How can i scan/fix the corrupt table , How do i check the Integrity of my Mysql Tables. Is there a way to solve this problem?

0

Share this post


Link to post
Share on other sites

Corrupted how? "Corrupted" is a very vague word, you can't just "scan for corrupted tables."

This is why you do backups. Trying to figure out what a query did and how to undo it is futile. If any rows were dropped or columns were altered incorrectly, you're out of luck. You can't repair it. What if a row lost an ID referring to another row? How are you going to get that back? You're not, it's gone.

0

Share this post


Link to post
Share on other sites

That's unlucky.

I used rollback in Oracle one time to save myself from a cock up, but it seems MySQL is set to auto-commits changes by default.

I just found http://forums.devarticles.com/mysql-develo...lback-6704.html this thread, perhaps using phpmyadmin changes the auto-commit setting it? that would be a lucky save.

Edited by Swerve
0

Share this post


Link to post
Share on other sites

Always check at the source first.

http://dev.mysql.com/doc/refman/5.1/en/myisamchk.html

http://dev.mysql.com/doc/refman/5.1/en/repair-table.html

Tables are repairable, but you have to be very cautious even during the repair process. Read the above carefully. Backup the corrupted database before you try to repair, lest something go even more wrong.

I agree with Ohm that backups are essential. Moving forward, you should strongly consider doing them. (note that you can do "hot" backups in mysql, so there's really no excuse not to write a quick backup script).

also, MySQL admin apps (such as Pretty Horrible PHP Admin) can cause more problems than they solve. Considering learning mysql from a command line.

Edited by Pan
0

Share this post


Link to post
Share on other sites

More often than corrupted tables and data are corrupted indexes. Did you just rebuild your indexes and see if that fixes it?

0

Share this post


Link to post
Share on other sites
This is why you do backups. . You can't repair it.

would you advise using acronis software ?

0

Share this post


Link to post
Share on other sites
This is why you do backups. . You can't repair it.

would you advise using acronis software ?

Sure, whatever backup tool you want to use. You can tar it in Linux if you want, it doesn't really matter as long as it's backed up.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0