locked
Seems like my SQL database is corrupted RRS feed

  • Question

  • 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.

    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.


    • Moved by Kalman Toth Wednesday, September 24, 2014 5:51 PM
    Tuesday, September 23, 2014 3:47 PM

Answers

  • May be there's somebody who can help her, who knows. It's big forum.
    NO we dont entertain any request apart from SQL Server so OP has to post it into Mysql forum I guess he has already done in DBA.Stackexchange so I would close this thread

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My Technet Articles

    • Proposed as answer by Shanky_621MVP Tuesday, September 23, 2014 4:21 PM
    • Marked as answer by Just Karl Thursday, November 20, 2014 10:23 PM
    Tuesday, September 23, 2014 4:21 PM

All replies

  • This is a microsoft sql server forum.
    Tuesday, September 23, 2014 3:53 PM
  • May be there's somebody who can help her, who knows. It's big forum.
    Tuesday, September 23, 2014 4:14 PM
  • This is totally off-topic but from the last line on your log you better had a backup.

    This may help you:

    http://rivenlinux.info/how-to-recover-innodb-corruption-for-mysql/


    "If there's nothing wrong with me, maybe there's something wrong with the universe!"

    Tuesday, September 23, 2014 4:18 PM
  • May be there's somebody who can help her, who knows. It's big forum.
    NO we dont entertain any request apart from SQL Server so OP has to post it into Mysql forum I guess he has already done in DBA.Stackexchange so I would close this thread

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My Technet Articles

    • Proposed as answer by Shanky_621MVP Tuesday, September 23, 2014 4:21 PM
    • Marked as answer by Just Karl Thursday, November 20, 2014 10:23 PM
    Tuesday, September 23, 2014 4:21 PM
  • Firstly, try a reboot of the server, it may have done a disk check on the intial reboot and not started up mysql cleanly. Another reboot with it being done properly may bring up the dbs without any hassle, although unlikely.

    You can try the mysql repair features? Google mysql repair.

    Example:

    Enter the following command at root prompt:

    mysqlcheck -r [database name]

    Where, mysqlcheck is the command to check the database, -r is the command to repair the corrupted tables. Replace the [database name] with your actual database name.

    Please note that MyISAM is a default storage engine of MySQL, unless you change it. Mostly MyISAM is set as default engine to check and repair all the tables in the mysql database.

    If the above doesn’t work, then you can try the following commands via the Linux shell prompt.

    myisamchk -r /var/lib/mysql/[database name]/*

    Good luck.

    Otherwise hope you have backups.


    Tuesday, September 23, 2014 4:22 PM
  • Nice to see you upvoted your own post. 
    Tuesday, September 23, 2014 5:05 PM