Seems like my SQL database is corrupted

  • CliffordPreston

    SSC Journeyman

    Points: 86

    I restarted my VPS box ( manually/hard restart ) and ever since, mysql fails to start for whatever reason. Can provide (if necessary) the error log. (It’s too large)

    So please tell me how to recover my database?

    PS - I did not make any updates to mysql. Version is mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (i486) using readline 5.2.

    I did a tail /var/log/syslog and I get this:

    Feb 20 11:49:33 kyrgyznews mysqld[11461]: ) ;InnoDB: End of page dump

    575 Feb 20 11:49:33 kyrgyznews mysqld[11461]: 110220 11:49:33 InnoDB: Page checksum 1045788239, prior-to-4.0.14-form checksum 236985105

    576 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: stored checksum 1178062585, prior-to-4.0.14-form stored checksum 236985105

    577 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: Page lsn 0 10651, low 4 bytes of lsn at page end 10651

    578 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: Page number (if stored to page already) 3,

    579 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: space id (if created with >= MySQL-4.1.1 and stored already) 0

    580 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: Database page corruption on disk or a failed

    581 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: file read of page 3.

    582 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: You may have to recover from a backup.

    583 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: It is also possible that your operating

    584 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: system has corrupted its own file cache

    585 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: and rebooting your computer removes the

    586 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: error.

    587 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: If the corrupt page is an index page

    588 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: you can also try to fix the corruption

    589 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: by dumping, dropping, and reimporting

    590 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: the corrupt table. You can use CHECK

    591 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: TABLE to scan your table for corruption.

    592 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: See also InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html

    593 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: about forcing recovery.

    594 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: Ending processing because of a corrupt database page.

    595 Feb 20 11:49:33 kyrgyznews mysqld_safe[11469]: ended

    596 Feb 20 11:49:47 kyrgyznews /etc/init.d/mysql[12228]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in

    597 Feb 20 11:49:47 kyrgyznews /etc/init.d/mysql[12228]: ^G/usr/bin/mysqladmin: connect to server at 'localhost' failed

    598 Feb 20 11:49:47 kyrgyznews /etc/init.d/mysql[12228]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'

    599 Feb 20 11:49:47 kyrgyznews /etc/init.d/mysql[12228]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!

    600 Feb 20 11:49:47 kyrgyznews /etc/init.d/mysql[12228]:

    601 Feb 20 11:49:56 kyrgyznews mysqld_safe[13437]: started

    602 Feb 20 11:49:56 kyrgyznews mysqld[13440]: InnoDB: The log sequence number in ibdata files does not match

    603 Feb 20 11:49:56 kyrgyznews mysqld[13440]: InnoDB: the log sequence number in the ib_logfiles!

    604 Feb 20 11:49:56 kyrgyznews mysqld[13440]: 110220 11:49:56 InnoDB: Database was not shut down normally!

    605 Feb 20 11:49:56 kyrgyznews mysqld[13440]: InnoDB: Starting crash recovery.

    606 Feb 20 11:49:56 kyrgyznews mysqld[13440]: InnoDB: Reading tablespace information from the .ibd files...

    607 Feb 20 11:49:56 kyrgyznews mysqld[13440]: InnoDB: Restoring possible half-written data pages from the doublewrite

    608 Feb 20 11:49:56 kyrgyznews mysqld[13440]: InnoDB: buffer...

    609 Feb 20 11:49:56 kyrgyznews mysqld[13440]: InnoDB: Database page corruption on disk or a failed

    610 Feb 20 11:49:56 kyrgyznews mysqld[13440]: InnoDB: file read of page 3.

    611 Feb 20 11:49:56 kyrgyznews mysqld[13440]: InnoDB: You may have to recover from a backup.

  • Lempster

    SSCoach

    Points: 15451

    This is a forum for Microsoft SQL Server not MySQL. You're more likely to get answers posting on a MySQL forum.

    Regards

    Lempster

  • CliffordPreston

    SSC Journeyman

    Points: 86

    Anyway maby anybody can help me here, I hope so. Thnks for advise.

  • Lowell

    SSC Guru

    Points: 323356

    CliffordPreston (9/23/2014)


    Feb 20 11:49:33 kyrgyznews mysqld[11461]: ) ;InnoDB: End of page dump

    575 Feb 20 11:49:33 kyrgyznews mysqld[11461]: 110220 11:49:33 InnoDB: Page checksum 1045788239, prior-to-4.0.14-form checksum 236985105

    576 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: stored checksum 1178062585, prior-to-4.0.14-form stored checksum 236985105

    577 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: Page lsn 0 10651, low 4 bytes of lsn at page end 10651

    578 Feb 20 11:49:33 kyrgyznews mysqld[11461]: InnoDB: Page number (if stored to page already) 3,

    that log seems to be six months or more old, are you sure that is the error you are really getting?

    that timestamp says Feb 20 11:49:33

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Luis Cazares

    SSC Guru

    Points: 183531

    It seems unlikely that someone can help you here. It's not that we're not willing to, it's only that most of us don't have the technical knowledge to do so.

    http://forums.mysql.com/

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Gail Shaw

    SSC Guru

    Points: 1004424

    CliffordPreston (9/23/2014)


    Anyway maby anybody can help me here, I hope so. Thnks for advise.

    Unlikely. The people here know SQL Server, not MySQL, and for fixing database corruption you really need to know the product very well. Try the MySQL forums.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • josephkemp

    SSC Rookie

    Points: 29

    Based on what is in that log I suggest you run some disk checking, as it's possible you have disk errors which are causing the corruption of the database. If the disk check out you may want to restore from your backup if you are unable to repair the database.

    Make sure the file /var/run/mysqld/mysqld.sock exists in your server. if not exist you can create it. this tuts will help you:

    http://www.filerepairforum.com/forum/microsoft/microsoft-aa/sql-server

    Or if you do not go, you can resort to extreme measures - install special software (I advise you to install only paid content, it will give a better chance of a successful recovery and a safer) to restore a damaged database: http://www.mysql.recoverytoolbox.com/[/url]

  • Eirikur Eiriksson

    SSC Guru

    Points: 182344

    Quick suggestion, gracefully power down the system, reboot using a good recovery distro such as backtrack, gparted etc., DON'T mount the drives but use dd_rescue to image the drive or the partition to another drive. Then work on the image and don't power up the original drive for any other purposes than to image it again.

    😎

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply