MYSQL - 查询期间与MySQL服务器的连接丢失

时间:2012-11-27 15:50:58

标签: mysql database phpmyadmin innodb

今天我试图导入一个因为我的最大数据包大小太小而失败的数据库(~650MB)。在尝试修复此问题时,由于某种原因数据库已损坏。

现在我遇到以下问题:

在PhpMyAdmin中,我尝试删除已损坏的表,并返回以下内容:

Fout
SQL-query: 

DROP DATABASE  `database_name`

MySQL retourneerde: 

#2013 - Lost connection to MySQL server during query 

每个其他数据库都可以正常运行。 我尝试了几种方法,甚至将innodb_force_recovery放入my.cnf文件中的6位。

有人经历过这样的事吗?

FULL错误输出为:

Markering - 27 nov. 2012 16:49:06
121127 16:49:18  InnoDB: Assertion failure in thread 4516245504 in file dict0dict.c line 2643
InnoDB: Failing assertion: for_table || ref_table
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.5/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
15:49:18 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=16777216
read_buffer_size=262144
max_used_connections=1
max_threads=151
thread_count=1
connection_count=1
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 134066 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x1010c9000
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 = 10d306ed8 thread_stack 0x40000
0   mysqld                              0x000000010027a4fc my_print_stacktrace + 44�
1   mysqld                              0x0000000100021134 handle_fatal_signal + 692�
2   libsystem_c.dylib                   0x00007fff836038ea _sigtramp + 26�
3   mysqld                              0x00000001002efd87 mtr_memo_push + 23�
4   libsystem_c.dylib                   0x00007fff8365adce abort + 143�
5   mysqld                              0x00000001002baf96 dict_foreign_add_to_cache + 998�
6   mysqld                              0x00000001002c09c6 dict_load_foreigns + 1414�
7   mysqld                              0x00000001002c2b5b dict_load_table + 1707�
8   mysqld                              0x00000001003212b1 row_drop_database_for_mysql + 129�
9   mysqld                              0x000000010030b322 _ZL22innobase_drop_databaseP10handlertonPc + 226�
10  mysqld                              0x0000000100022601 _ZL17dropdb_handlertonP3THDP13st_plugin_intPv + 33�
11  mysqld                              0x0000000100178f7d _Z24plugin_foreach_with_maskP3THDPFcS0_P13st_plugin_intPvEijS3_ + 845�
12  mysqld                              0x0000000100140de3 _Z11mysql_rm_dbP3THDPcbb + 1859�
13  mysqld                              0x0000000100167143 _Z21mysql_execute_commandP3THD + 13491�
14  mysqld                              0x000000010016a386 _Z11mysql_parseP3THDPcjP12Parser_state + 294�
15  mysqld                              0x000000010016b49d _Z16dispatch_command19enum_server_commandP3THDPcj + 1709�
16  mysqld                              0x000000010016c387 _Z10do_commandP3THD + 231�
17  mysqld                              0x000000010020b581 _Z24do_handle_one_connectionP3THD + 353�
18  mysqld                              0x000000010020b639 handle_one_connection + 73�
19  libsystem_c.dylib                   0x00007fff83615742 _pthread_start + 327�
20  libsystem_c.dylib                   0x00007fff83602181 thread_start + 13�

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (10e002810): is an invalid pointer
Connection ID (thread ID): 9
Status: NOT_KILLED

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.
121127 16:49:19 mysqld_safe mysqld restarted
121127 16:49:19 [Warning] Setting lower_case_table_names=2 because file system for /Library/Application Support/appsolute/MAMP PRO/db/mysql/ is case insensitive
121127 16:49:19 [Note] Plugin 'FEDERATED' is disabled.
121127 16:49:19 InnoDB: The InnoDB memory heap is disabled
121127 16:49:19 InnoDB: Mutexes and rw_locks use GCC atomic builtins
121127 16:49:19 InnoDB: Compressed tables use zlib 1.2.3
121127 16:49:19 InnoDB: Initializing buffer pool, size = 128.0M
121127 16:49:19 InnoDB: Completed initialization of buffer pool
121127 16:49:19 InnoDB: highest supported file format is Barracuda.
InnoDB: The user has set SRV_FORCE_NO_LOG_REDO on
InnoDB: Skipping log redo
121127 16:49:19  InnoDB: Waiting for the background threads to start
121127 16:49:20 InnoDB: 1.1.8 started; log sequence number 0
121127 16:49:20 InnoDB: !!! innodb_force_recovery is set to 6 !!!
121127 16:49:20 [Note] Event Scheduler: Loaded 0 events
121127 16:49:20 [Note] /Applications/MAMP/Library/bin/mysqld: ready for connections.
Version: '5.5.25'  socket: '/Applications/MAMP/tmp/mysql/mysql.sock'  port: 0  Source distribution

1 个答案:

答案 0 :(得分:4)

如果您已尝试过每个innodb_force_recovery值,(3会停止回滚或转发交易),那么我只能指向以下

为了切入追逐,此网页上的人最终删除了innodb文件。

  

直到最后我找不到这个问题的明确解决方案......但是如果你在测试环境中,你可以删除ibdata1和ib_logfile0,ib_logfile1并重新启动服务器。这适用于我的情况。

http://www.randombugs.com/linux/crash-innodb-table.html

显然,如果您有大量其他数据库,这将涉及备份和恢复这些数据库。如果你发现任何其他方法,我建议你先试试。

Percona提供了一组数据恢复工具,但在您的情况下,数据不是问题

http://code.google.com/p/innodb-tools/

https://launchpad.net/percona-data-recovery-tool-for-innodb