.ibd檔案壞了怎麼辦?

psufnxk2000發表於2015-05-27
.ibd檔案壞了怎麼辦?
在5.6版本中使用vi修改了t3.ibd檔案後,重新啟動庫 


150527 18:03:44 mysqld_safe Starting mysqld daemon with databases from /data 
2015-05-27 18:03:44 0 [Warning] Using unique option prefix character_set_client instead of character-set-client-handshake is deprecated and will be removed in a future release. Please use the full name instead. 
2015-05-27 18:03:44 0 [Warning] /usr/sbin/mysqld: ignoring option '--character-set-client-handshake' due to invalid value 'gbk' 
2015-05-27 18:03:44 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 
2015-05-27 18:03:44 4179 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000) 

2015-05-27 18:03:44 4179 [Warning] Buffered warning: Changed limits: table_cache: 431 (requested 2000) 

2015-05-27 18:03:44 4179 [Note] Plugin 'FEDERATED' is disabled. 
2015-05-27 18:03:44 4179 [Note] InnoDB: Using atomics to ref count buffer pool pages 
2015-05-27 18:03:44 4179 [Note] InnoDB: The InnoDB memory heap is disabled 
2015-05-27 18:03:44 4179 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 
2015-05-27 18:03:44 4179 [Note] InnoDB: Memory barrier is not used 
2015-05-27 18:03:44 4179 [Note] InnoDB: Compressed tables use zlib 1.2.3 
2015-05-27 18:03:44 4179 [Note] InnoDB: Using Linux native AIO 
2015-05-27 18:03:44 4179 [Note] InnoDB: Using CPU crc32 instructions 
2015-05-27 18:03:44 4179 [Note] InnoDB: Initializing buffer pool, size = 128.0M 
2015-05-27 18:03:44 4179 [Note] InnoDB: Completed initialization of buffer pool 
2015-05-27 18:03:44 4179 [Note] InnoDB: Highest supported file format is Barracuda. 
2015-05-27 18:03:44 4179 [Note] InnoDB: The log sequence numbers 105041521 and 105041521 in ibdata files do not match the log sequence number 105041531 in the ib_logfiles! 
2015-05-27 18:03:44 4179 [Note] InnoDB: Database was not shutdown normally! 
2015-05-27 18:03:44 4179 [Note] InnoDB: Starting crash recovery. 
2015-05-27 18:03:44 4179 [Note] InnoDB: Reading tablespace information from the .ibd files... 
2015-05-27 18:03:44 4179 [ERROR] InnoDB: innodb-page-size mismatch in tablespace ./ttt/t3.ibd (table ttt/t3) 
2015-05-27 18:03:44 4179 [Note] InnoDB: Page size:1024 Pages to analyze:64 
2015-05-27 18:03:44 4179 [Note] InnoDB: Page size: 1024, Possible space_id count:0 
2015-05-27 18:03:44 4179 [Note] InnoDB: Page size:2048 Pages to analyze:48 
2015-05-27 18:03:44 4179 [Note] InnoDB: Page size: 2048, Possible space_id count:0 
2015-05-27 18:03:44 4179 [Note] InnoDB: Page size:4096 Pages to analyze:24 
2015-05-27 18:03:44 4179 [Note] InnoDB: Page size: 4096, Possible space_id count:0 
2015-05-27 18:03:44 4179 [Note] InnoDB: Page size:8192 Pages to analyze:12 
2015-05-27 18:03:44 4179 [Note] InnoDB: Page size: 8192, Possible space_id count:0 
2015-05-27 18:03:44 4179 [Note] InnoDB: Page size:16384 Pages to analyze:6 
2015-05-27 18:03:44 4179 [Note] InnoDB: Page size: 16384, Possible space_id count:0 
2015-05-27 18:03:44 7fc5b1e70720 InnoDB: Operating system error number 2 in a file operation. 
InnoDB: The error means the system cannot find the path specified. 
InnoDB: If you are installing InnoDB, remember that you must create 
InnoDB: directories yourself, InnoDB does not create them. 
InnoDB: Error: could not open single-table tablespace file ./ttt/t3.ibd 
InnoDB: We do not continue the crash recovery, because the table may become 
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it. 
InnoDB: To fix the problem and start mysqld: 
InnoDB: 1) If there is a permission problem in the file and mysqld cannot 
InnoDB: open the file, you should modify the permissions. 
InnoDB: 2) If the table is not needed, or you can restore it from a backup, 
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal 
InnoDB: crash recovery and ignore that table. 
InnoDB: 3) If the file system or the disk is broken, and you cannot remove 
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf 
InnoDB: and force InnoDB to continue crash recovery here. 
150527 18:03:44 mysqld_safe mysqld from pid file /data/localhost.localdomain.pid ended 

inndob_force_recovery=1後:再次啟動: 



150527 18:05:35 mysqld_safe Starting mysqld daemon with databases from /data 
2015-05-27 18:05:36 0 [Warning] Using unique option prefix character_set_client instead of character-set-client-handshake is deprecated and will be removed in a future release. Please use the full name instead. 
2015-05-27 18:05:36 0 [Warning] /usr/sbin/mysqld: ignoring option '--character-set-client-handshake' due to invalid value 'gbk' 
2015-05-27 18:05:36 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 
2015-05-27 18:05:36 4411 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000) 

2015-05-27 18:05:36 4411 [Warning] Buffered warning: Changed limits: table_cache: 431 (requested 2000) 

2015-05-27 18:05:36 4411 [Note] Plugin 'FEDERATED' is disabled. 
2015-05-27 18:05:36 4411 [Note] InnoDB: Using atomics to ref count buffer pool pages 
2015-05-27 18:05:36 4411 [Note] InnoDB: The InnoDB memory heap is disabled 
2015-05-27 18:05:36 4411 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 
2015-05-27 18:05:36 4411 [Note] InnoDB: Memory barrier is not used 
2015-05-27 18:05:36 4411 [Note] InnoDB: Compressed tables use zlib 1.2.3 
2015-05-27 18:05:36 4411 [Note] InnoDB: Using Linux native AIO 
2015-05-27 18:05:36 4411 [Note] InnoDB: Using CPU crc32 instructions 
2015-05-27 18:05:36 4411 [Note] InnoDB: Initializing buffer pool, size = 128.0M 
2015-05-27 18:05:36 4411 [Note] InnoDB: Completed initialization of buffer pool 
2015-05-27 18:05:36 4411 [Note] InnoDB: Highest supported file format is Barracuda. 
2015-05-27 18:05:36 4411 [Note] InnoDB: The log sequence numbers 105041521 and 105041521 in ibdata files do not match the log sequence number 105041531 in the ib_logfiles! 
2015-05-27 18:05:36 4411 [Note] InnoDB: Database was not shutdown normally! 
2015-05-27 18:05:36 4411 [Note] InnoDB: Starting crash recovery. 
2015-05-27 18:05:36 4411 [Note] InnoDB: Reading tablespace information from the .ibd files... 
2015-05-27 18:05:36 7fe6b81dd720 InnoDB: Assertion failure in thread 140628908168992 in file fil0fil.cc line 1243 
InnoDB: Failing assertion: fsp_flags_is_valid(flags) 
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 be 
InnoDB: corruption in the InnoDB tablespace. Please refer to 
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html 
InnoDB: about forcing recovery. 
10:05:36 UTC - mysqld got signal 6 ; 
This could be because you hit a bug. It is also possible that this binary 
or one of the libraries it was linked against is corrupt, improperly built, 
or misconfigured. This error can also be caused by malfunctioning hardware. 
We will try our best to scrape up some info that will hopefully help 
diagnose the problem, but since we have already crashed, 
something is definitely wrong and this may fail. 

key_buffer_size=8388608 
read_buffer_size=131072 
max_used_connections=0 
max_threads=151 
thread_count=0 
connection_count=0 
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 68245 K bytes of memory 
Hope that's ok; if not, decrease some variables in the equation. 

Thread pointer: 0x0 
Attempting backtrace. You can use the following information to find out 
where mysqld died. If you see no messages after this, something went 
terribly wrong... 
stack_bottom = 0 thread_stack 0x40000 
/usr/sbin/mysqld(my_print_stacktrace+0x35)[0x911b05] 
/usr/sbin/mysqld(handle_fatal_signal+0x494)[0x69a1c4] 
/lib64/libpthread.so.0[0x35e680f4a0] 
/lib64/libc.so.6(gsignal+0x35)[0x35e6032885] 
/lib64/libc.so.6(abort+0x175)[0x35e6034065] 
/usr/sbin/mysqld[0xad042d] 
/usr/sbin/mysqld[0xad1750] 
/usr/sbin/mysqld[0x9b8002] 
/usr/sbin/mysqld[0x9be10d] 
/usr/sbin/mysqld[0xa36120] 
/usr/sbin/mysqld[0x97cafd] 
/usr/sbin/mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x48)[0x5de3f8] 
/usr/sbin/mysqld[0x722f61] 
/usr/sbin/mysqld(_Z11plugin_initPiPPci+0xbb6)[0x726c96] 
/usr/sbin/mysqld[0x5d1458] 
/usr/sbin/mysqld(_Z11mysqld_mainiPPc+0x425)[0x5d5f35] 
/lib64/libc.so.6(__libc_start_main+0xfd)[0x35e601ecdd] 
/usr/sbin/mysqld[0x5c79a9] 
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains 
information that should help you find out what is causing the crash. 
150527 18:05:36 mysqld_safe mysqld from pid file /data/localhost.localdomain.pid ended 





inndob_force_recovery=6後:再次啟動: 

150527 22:07:23 mysqld_safe Starting mysqld daemon with databases from /data 
2015-05-27 22:07:23 0 [Warning] Using unique option prefix character_set_client instead of character-set-client-handshake is deprecated and will be removed in a future release. Please use the full name instead. 
2015-05-27 22:07:23 0 [Warning] /usr/sbin/mysqld: ignoring option '--character-set-client-handshake' due to invalid value 'gbk' 
2015-05-27 22:07:23 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 
2015-05-27 22:07:23 6311 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000) 

2015-05-27 22:07:23 6311 [Warning] Buffered warning: Changed limits: table_cache: 431 (requested 2000) 

2015-05-27 22:07:23 6311 [Note] Plugin 'FEDERATED' is disabled. 
2015-05-27 22:07:23 6311 [Note] InnoDB: Started in read only mode 
2015-05-27 22:07:23 6311 [Note] InnoDB: Using atomics to ref count buffer pool pages 
2015-05-27 22:07:23 6311 [Note] InnoDB: The InnoDB memory heap is disabled 
2015-05-27 22:07:23 6311 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 
2015-05-27 22:07:23 6311 [Note] InnoDB: Memory barrier is not used 
2015-05-27 22:07:23 6311 [Note] InnoDB: Compressed tables use zlib 1.2.3 
2015-05-27 22:07:23 6311 [Note] InnoDB: Using Linux native AIO 
2015-05-27 22:07:23 6311 [Note] InnoDB: Using CPU crc32 instructions 
2015-05-27 22:07:23 6311 [Note] InnoDB: Disabling background IO write threads. 
2015-05-27 22:07:23 6311 [Note] InnoDB: Initializing buffer pool, size = 128.0M 
2015-05-27 22:07:23 6311 [Note] InnoDB: Completed initialization of buffer pool 
2015-05-27 22:07:23 6311 [Note] InnoDB: Highest supported file format is Barracuda. 
2015-05-27 22:07:23 6311 [Note] InnoDB: The user has set SRV_FORCE_NO_LOG_REDO on, skipping log redo 
2015-05-27 22:07:23 6311 [Note] InnoDB: 5.6.23 started; log sequence number 0 
2015-05-27 22:07:23 6311 [Note] InnoDB: !!! innodb_force_recovery is set to 6 !!! 
2015-05-27 22:07:23 6311 [Note] Recovering after a crash using /data/bin/bin 
2015-05-27 22:07:23 6311 [Note] Starting crash recovery... 
2015-05-27 22:07:23 6311 [Note] Crash recovery finished. 
2015-05-27 22:07:23 6311 [Note] RSA private key file not found: /data//private_key.pem. Some authentication plugins will not work. 
2015-05-27 22:07:23 6311 [Note] RSA public key file not found: /data//public_key.pem. Some authentication plugins will not work. 
2015-05-27 22:07:23 6311 [Note] Server hostname (bind-address): '*'; port: 3306 
2015-05-27 22:07:23 6311 [Note] IPv6 is available. 
2015-05-27 22:07:23 6311 [Note] - '::' resolves to '::'; 
2015-05-27 22:07:23 6311 [Note] Server socket created on IP: '::'. 
2015-05-27 22:07:23 6311 [ERROR] InnoDB: Failed to find tablespace for table '"mysql"."slave_master_info"' in the cache. Attempting to load the tablespace with space id 4. 
2015-05-27 22:07:23 6311 [Warning] InnoDB: Allocated tablespace 4, old maximum was 0 
2015-05-27 22:07:23 6311 [ERROR] InnoDB: Failed to find tablespace for table '"mysql"."slave_worker_info"' in the cache. Attempting to load the tablespace with space id 5. 
2015-05-27 22:07:23 6311 [ERROR] InnoDB: Failed to find tablespace for table '"mysql"."slave_relay_log_info"' in the cache. Attempting to load the tablespace with space id 3. 
2015-05-27 22:07:23 6311 [Note] Event Scheduler: Loaded 0 events 
2015-05-27 22:07:23 6311 [Note] /usr/sbin/mysqld: ready for connections. 
Version: '5.6.23-enterprise-commercial-advanced-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Enterprise Server - Advanced Edition (Commercial) 

mysql> select count(*) from t3; 
+----------+ 
| count(*) | 
+----------+ 
| 1000 | 
+----------+ 
1 row in set (0.00 sec) 
mysql> select * from t3; --也可以正常顯示 

這時就可以備份這個表的記錄,或者是整個庫。 
比如說備份了整個庫,這時就可以把資料庫初始化,然後把庫匯入


轉載請註明源出處
QQ 273002188  歡迎一起學習

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25099483/viewspace-1674477/,如需轉載,請註明出處,否則將追究法律責任。

相關文章