After MySQL starts, the problem is resolved (ibdata1 file corruption is caused)

Source: Internet
Author: User

Computer room A server on the MySQL run for some time, suddenly appeared a very strange phenomenon: After restarting can not be restored! The exact situation is: After starting MySQL, it is closed again.

View the MySQL error log as follows:

160920 22:41:41 Mysqld_safe starting mysqld daemon with databases from/home/mysqldata/
2016-09-20 22:41:41 0 [Note]/data/app/mysql5.6.25/bin/mysqld (mysqld 5.6.25-log) starting as Process 32372 ...
2016-09-20 22:41:42 32372 [Note]Plugin ' federated ' is disabled.
2016-09-20 22:41:42 32372[Warning] option ' innodb-write-io-threads ': Unsigned value adjusted to
2016-09-20 22:41:42 32372[Warning] option ' innodb-read-io-threads ': Unsigned value adjusted to
2016-09-20 22:41:42 32372 [Note] innodb:using Atomics to ref count buffer pool pages
2016-09-20 22:41:42 32372 [Note] innodb:the InnoDB memory heap is disabled
2016-09-20 22:41:42 32372 [Note] innodb:mutexes and rw_locks use GCC atomic builtins
2016-09-20 22:41:42 32372 [Note] innodb:memory barrier is not used
2016-09-20 22:41:42 32372 [Note] innodb:compressed tables use zlib 1.2.3
2016-09-20 22:41:42 32372 [Note] innodb:using CPU CRC32 Instructions
2016-09-20 22:41:42 32372 [Note] innodb:initializing buffer pool, size = 1.0G
2016-09-20 22:41:42 32372 [Note] innodb:completed initialization of buffer pool
2016-09-20 22:41:42 32372 [Note] innodb:highest supported file format is Barracuda.
2016-09-20 22:41:42 32372 [Note] innodb:log scan progressed past the checkpoint LSN 20293587957
2016-09-20 22:41:42 32372 [note] InnoDB:Database is not shutdown normally!
2016-09-20 22:41:42 32372 [Note] innodb:starting crash recovery.
2016-09-20 22:41:42 32372 [Note] innodb:reading tablespace information from the. ibd files ...
2016-09-20 22:41:42 32372 [Note] innodb:restoring possible half-written data pages
2016-09-20 22:41:42 32372 [Note] innodb:from the doublewrite buffer ...
innodb:doing recovery:scanned up to log sequence number 20293596130
2016-09-20 22:41:42 32372 [Note] innodb:starting an apply batch of log records to the database ...
Innodb:progress in percent:49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
innodb:apply Batch Completed
Innodb:last MySQL binlog file position 0 136254, file name mysql-bin.000013
2016-09-20 22:41:43 32372 [Note] innodb:128 rollback segment (s) is active.
2016-09-20 22:41:43 32372 [Note] innodb:waiting for purge to start
2016-09-20 22:41:43 7f77a9edd700 innodb:assertion failure in thread 140151928772352 in file trx0purge.cc line 699
innodb:failing assertion:purge_sys->iter.trx_no <= purge_sys->rseg->last_trx_no
Innodb:we intentionally generate a memory trap.
Innodb:submit a detailed bug report to http://bugs.mysql.com.
Innodb:if you get repeated assertion failures or crashes, even
Innodb:immediately after the mysqld startup, there may
Innodb:corruption in the InnoDB tablespace. Refer to
Innodb:http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
Innodb:about forcing recovery.
02:41:43 Utc-mysqld got signal 6;
This could is because a bug. It is also possible the this binary
Or one of the libraries it was linked against IS corrupt, improperly built,
Or misconfigured. This error can also is caused by malfunctioning hardware.
We'll try our best to scrape up some info, that'll hopefully help
Diagnose the problem, but since we have already crashed,
Something is definitely wrong and this may fail.

After analyzing the log, it was found that the database could not be restarted because the Ibdata1 file was corrupted and could not be resumed after a reboot.

Workaround:
you need to skip the recovery step , modify the My.cnf file, and add it in [Mysqld] in MY.CNF:
Innodb_force_recovery = 6
Innodb_purge_threads = 1

Explain:

The innodb_force_recovery can be set to 1-6, and the large number contains the effect of all previous numbers.
The exact number corresponds to the meaning:
1-----(srvforceignorecorrupt): Ignores corrupt pages that are checked.
2-----(Srvforcenobackground): Prevents the main thread from running, as the main thread needs to perform full purge operations, which can cause crash.
3-----(Srvforcenotrxundo): The transaction rollback operation is not performed.
4-----(Srvforcenoibufmerge): does not perform a merge operation for insert Buffering.
5-----(Srvforcenoundologscan): Do not look for logs, InnoDB the storage engine treats uncommitted transactions as committed.
6-----(Srvforcenolog_redo): Do not roll forward operations.

Starting MySQL again is OK ~


If you cannot start, you will need to delete files such as ibdata1,ib_logfile* under Data directory datafile.

After startup, export the MySQL database and restore it again.

After MySQL starts, the problem is resolved (ibdata1 file corruption is caused)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.