.ibd文件坏了怎么办?

.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/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/25099483/viewspace-1674477/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值