MySQL unexpected power outage, InnoDB database recovery

Source: Internet
Author: User
Tags deprecated percona percona server

Customer database in the operation of a sudden power outage, when the server restart found that MySQL could not start, view the log, error as follows:

151105 11:24:52 Mysqld_safe starting mysqld daemon with databases from/data/mysql/datafile151105 11:24:52 [Warning] Using Unique option prefix Myisam_recover instead of myisam-recover-options is deprecated and would be removed in a future Relea Se. Click the full name instead.151105 11:24:52 [Warning] Using the unique option prefix myisam_recover instead of Myisam-rec Over-options is deprecated and would be removed in a future release.  instead.151105 11:24:52 innodb:the InnoDB memory heap is disabled151105 11:24:52 innodb:mutexes and rw_locks use GCC atomic builtins151105 11:24:52 innodb:compressed tables use zlib 1.2.3151105 11:24:52 Innodb:initi Alizing buffer pool, size = 512.0m151105 11:24:52 innodb:completed initialization of buffer pool151105 11:24:52 innodb:h Ighest supported file format is BARRACUDA.INNODB:THE log sequence number in Ibdata files does not matchinnodb:the log se Quence number in the ib_logfiles!151105 11:24:52 innodb:database is not Shut down normally! Innodb:starting crash recovery. innodb:reading tablespace information from the. ibd files ... innodb:restoring possible Half-written data pages from the Doublewriteinnodb:buffer ... 151105 11:24:52 InnoDB:ERROR:We were only able to scan the log up toinnodb:2735615488, but a checkpoint is at 2735615 806.innodb:it is possible and the database is now corrupt! Innodb:3 transaction (s) which must be rolled back or cleaned upinnodb:in total 3 row operations to Undoinnodb:trx ID CO Unter is 6d84900innodb:last MySQL binlog file position 0 446116929, file Name/data/mysql/binlog/mysql-bin.001288innodb: Cleaning up Trx with ID 6d7c116innodb:cleaning up TRX with ID 6d74419innodb:cleaning up TRX with ID 6d6f27e151105 11:24: Innodb:waiting for the background threads to start151105 11:24:52 innodb:assertion failure in thread 14010856853273 6 in file trx0purge.c line 848innodb:failing assertion:purge_sys->purge_trx_no <= purge_sys->rseg->last_ Trx_noinnodB: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, E Veninnodb:immediately after the mysqld startup, there could beinnodb:corruption in the InnoDB tablespace. Please refer toinnodb:http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.htmlinnodb:about forcing Recovery.03:24:52 Utc-mysqld got signal 6; This could is because a bug. It's also possible that's binaryor one of the libraries it was linked against are corrupt, improperly built,or misconfi Gured. This error can also is caused by malfunctioning hardware. We'll try our best to scrape up some info that'll hopefully helpdiagnose the problem, but since we have already crashe D, something is definitely wrong and this may fail. Percona Server better by reporting anybugs at Http://bugs.percona.com/key_buffer_size=402653184read_b uffer_size=4194304max_used_connections=0max_threads=2002thread_count=0connection_count=0it is possible this mysqld could use up to Key_buffer_size + (Read_buffer_size + sort_buf fer_size) *max_threads = 16818378 K bytes of memoryhope that ' s OK; If not, decrease some variables in the equation. Thread pointer:0x0attempting BackTrace. You can use the following information to find Outwhere Mysqld died. If you see no messages after this, something wentterribly wrong...stack_bottom = 0 Thread_stack 0x40000/usr/local/percona- Server-5.5.38-35.2/bin/mysqld (my_print_stacktrace+0x2e) [0x7785ae]/usr/local/percona-server-5.5.38-35.2/bin/ Mysqld (handle_fatal_signal+0x43a) [0x66a1da]/lib64/libpthread.so.0[0x379c20f710]/lib64/libc.so.6 (GSIGNAL+0X35) [ 0x379be32925]/lib64/libc.so.6 (abort+0x175) [0x379be34105]/usr/local/percona-server-5.5.38-35.2/bin/mysqld[ 0x814fb0]/usr/local/percona-server-5.5.38-35.2/bin/mysqld[0x8153f7]/usr/local/percona-server-5.5.38-35.2/bin/ Mysqld[0x8e318f]/usr/local/percona-server-5.5.38-35.2/bin/mysqld[0x8d98d5]/usr/local/percona-server-5.5.38-35.2/bin/mysqld[0x813c4e]/usr/local/percona-server-5.5.38-35.2/bin/mysqld[0x809d2c]/lib64/ Libpthread.so.0[0x379c2079d1]/lib64/libc.so.6 (clone+0x6d) [0x379bee8b5d]you may download the Percona Server Operations Manual by visitinghttp://www.percona.com/software/percona-server/. You may find informationin the manual which would help you identify the cause of the crash.151105 11:24:52 mysqld_safe mysq LD from PID File/data/mysql/datafile/mysql.pid ended

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

Now we need to skip the recovery step, modify the my.cnf file, add it in the MY.CNF [mysqld]

innodb_force_recovery = 6innodb_purge_threads = 0

InnoDBForce recovery can be set to 1-6, and large numbers contain the effect of all previous numbers.
1. (SRVforce IGNORECorrupt): Ignores corrupt pages that are checked.
2. (SRV
ForceNOBACKGROUND): Prevents the main thread from running, as the main thread needs to perform full purge operations, which can cause crash.
3. (SRVForce noTRXUNDO): The transaction rollback operation is not performed.
4. (SRVForce noibufmerge): Do not perform insert buffer merge operations.
5. (SRVForce noUNDOlogSCAN): The InnoDB storage Engine treats uncommitted transactions as committed without checking for logs.
6. (SRV
ForcenoLog_redo): Do not roll forward operations.

Start again, and if it does not start then delete the data directory datafile ibdata1 , ib_logfile* etc. files.

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

MySQL unexpected power outage, InnoDB database recovery

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.