MySQL sudently stop working, when start manually mysqld with `mysqld`` command:

# mysqld
160805 11:34:10 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
160805 11:34:10 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
160805 11:34:10 [Note] Plugin 'FEDERATED' is disabled.
160805 11:34:10 InnoDB: The InnoDB memory heap is disabled
160805 11:34:10 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160805 11:34:10 InnoDB: Compressed tables use zlib 1.2.7
160805 11:34:10 InnoDB: Using Linux native AIO
160805 11:34:10 InnoDB: Initializing buffer pool, size = 128.0M
160805 11:34:10 InnoDB: Completed initialization of buffer pool
160805 11:34:10 InnoDB: highest supported file format is Barracuda.
InnoDB: Error: trying to access page number 46616 in space 0,
InnoDB: space name ./ibdata1,
InnoDB: which is outside the tablespace bounds.
InnoDB: Byte offset 0, len 16384, i/o type 10.
InnoDB: If you get this error at mysqld startup, please check that
InnoDB: your my.cnf matches the ibdata files that you have in the
InnoDB: MySQL server.
160805 11:34:10  InnoDB: Assertion failure in thread 140324139591456 in file fil0fil.c line 4578
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.
09:34:10 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.

It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 346700 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 0x30000
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.

Tryied in my.cnf

innodb_force_recovery = 1

without change. Where can i investiguate ?


As the log indicates, you might have changed the values of the following parameters:

  • key_buffer_size
  • read_buffer_size
  • sort_buffer_size
  • max_threads

If you have changed one of these values, try to revert the change and start the MySQL server again.

If you have not changed the values, calculate the memory usage by:

key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads

If you find the system installed memory is sufficient, you need to check if there is a corrupted table in your databases:

innodb_force_recovery = 6

Then, to find out which database table is corrupted:

# mysqlcheck --all-databases

Write down all the tables listed as corrupted, you have to export the corrupted tables by:

# mysqldump -u{username} -p{password} {database_name} {table_name} > table_backup.sql

After that, you can drop the table in Mysql console:

Mysql> drop table {corrupted_table_name};

Then, we have to change back the Mysql configuration:

innodb_force_recovery = 0

The MySQL server should be able to start up with normal operation mode.

Next, we have to import the data of corrupted tables:

# mysql -u{username} -p{password} {database_name} < table_backup.sql

If everything runs fine, you should have your table data back and working Mysql Server.

Reference: InnoDB table recovery step-by-step-guide

| improve this answer | |
  • At step mysqlcheck, got a list of table as 'OK', then: "mysqlcheck: Got error: 2013: Lost connection to MySQL server during query when executing 'CHECK TABLE ... '" without database/table name. How to know wich is corrupted ? – bux Aug 6 '16 at 9:34
  • Please check your current value of wait_timeout under my.ini configuration file and increase the value to higher value, e.g. 28800 to see whether the check can be finished – Simon MC. Cheng Aug 6 '16 at 14:03
  • Same behaviour with wait_timeout set to 28800 under [wait_timeout] in /etc/mysql/my.cnf. – bux Aug 6 '16 at 21:09
  • Then I think a better solution is to do a system restore for all your databases mysqldump -u{username} -p{password} --all-databases > database_backup.sql, then drop all your databases one by one except mysql, information_schema, then restart the server by setting to innodb_force_recovery = 0, if it is able to start, run mysql -u{username} -p{password} < database_backup.sql to recover your data – Simon MC. Cheng Aug 7 '16 at 11:00
  • When drop a database, got "ERROR 2013 (HY000): Lost connection to MySQL server during query". Drop query work for one other database. – bux Aug 17 '16 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy