2

Today i was trying to import a database(~650MB) which failed because of my max packet size was too small.. While trying to fix this, for some reason the database got corrupted.

Now i have the following problem:

In PhpMyAdmin i try to drop the table which is corrupted and it returns the following:

Fout
SQL-query: 

DROP DATABASE  `database_name`

MySQL retourneerde: 

#2013 - Lost connection to MySQL server during query 

Every single other database works fine, exept for this one. I tried several ways, even by putting innodb_force_recovery to 6 in my.cnf file.

Does someone ever experienced something like this?

The FULL error output is:

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
2
  • Can you DROP or TRUNCATE individual tables in the database? Commented Nov 27, 2012 at 15:54
  • I can drop, truncate with every single table/database, exept for that specific one. Commented Nov 27, 2012 at 16:11

1 Answer 1

4

If you have tried each of the innodb_force_recovery values, (3 stops transactions being rolled back or forward), then I can only point you at the following

To cut to the chase, the person on this web page ended up deleteing the innodb files.

Until the end I don’t find a clear solution to this problem … but if you are on a testing environment you can just delete ibdata1 and ib_logfile0, ib_logfile1 and restart the server. This worked in my case.

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

Obviously, if you have a load of other databases, this will involve backing up and restoring those aswell. If you find any other way around this, I suggest you try it first.

Percona provide a set of data recovery tools, but in your case the data is not the problem

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

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

Sign up to request clarification or add additional context in comments.

4 Comments

I had the same problem, and deleting ibdata1 and the log files worked for me.
Too bad this wouldnt work out for me.. Now i made back-ups of my important databases and tried a clean start. But i still have my databases??
I ended up backing up some of my databases which were not corrupted, and did a clean install.
I also had the same error but for another reason. Simply by deleting all 'ib'-files (ib_logfile0, ib_logfile1, ibdata1) inside MAMP/db/mysql/ the problem was solved. I removed the files and restarted the MAMP-Server. After that, MAMP recreated the ib-Files and everything worked like a charm!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.