Banco MySQL corrompido

Hoje um colega de trabalho entrou em contato comigo, pois dois bancos MySQL (após o apagão de 10/11/2009) não subiam mais.

Essa era a mensagem que os logs (mysqld.log) apresentavam:

 

InnoDB: Starting crash recovery.

InnoDB: Reading tablespace information from the .ibd files…

InnoDB: Restoring possible half-written data pages from the doublewrite

InnoDB: buffer…

InnoDB: Doing recovery: scanned up to log sequence number 468 3362699776

InnoDB: Doing recovery: scanned up to log sequence number 468 3367942656

InnoDB: Doing recovery: scanned up to log sequence number 468 3373185536

InnoDB: Doing recovery: scanned up to log sequence number 468 3377730086

091111 10:25:44 InnoDB: Starting an apply batch of log records to the database…

InnoDB: Progress in percents: 0 1 2 3 4 5 6 7 8 9 10 11 12 091111 10:25:45 – mysqld got signal 11 ;

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=0

read_buffer_size=8388608

max_used_connections=0

max_connections=1000

threads_connected=0

It is possible that mysqld could use up to

key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 16384000 K

bytes of memory

Hope that’s ok; if not, decrease some variables in the equation.

 

thd=(nil)

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…

frame pointer is NULL, did you compile with

-fomit-frame-pointer? Aborting backtrace!

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.

091111 10:25:45 mysqld ended

 

A solução foi executar o comando myisamchk, em todos os bancos e tabelas, e em seguida o banco subiu normalmente.

 

[root@sgfmon01 mysql]# myisamchk –silent –force */*.MYI

myisamchk: MyISAM file cacti/host.MYI

myisamchk: warning: 7 clients are using or haven’t closed the table properly

myisamchk: MyISAM file cacti/host_snmp_cache.MYI

myisamchk: warning: 2 clients are using or haven’t closed the table properly

myisamchk: MyISAM file cacti/poller_command.MYI

myisamchk: warning: 2 clients are using or haven’t closed the table properly

myisamchk: MyISAM file cacti/poller_item.MYI

myisamchk: warning: 7 clients are using or haven’t closed the table properly

myisamchk: MyISAM file cacti/poller_output.MYI

myisamchk: warning: 5 clients are using or haven’t closed the table properly

myisamchk: MyISAM file cacti/poller_reindex.MYI

myisamchk: warning: 6 clients are using or haven’t closed the table properly

myisamchk: MyISAM file cacti/poller_time.MYI

myisamchk: warning: 1 client is using or hasn’t closed the table properly

myisamchk: MyISAM file cacti/settings.MYI

myisamchk: warning: 8 clients are using or haven’t closed the table properly

myisamchk: MyISAM file cacti/user_log.MYI

myisamchk: warning: 1 client is using or hasn’t closed the table properly

myisamchk: MyISAM file mysql/db.MYI

myisamchk: warning: 1 client is using or hasn’t closed the table properly

myisamchk: MyISAM file mysql/user.MYI

myisamchk: warning: 1 client is using or hasn’t closed the table properly

[root@sgfmon01 mysql]# /etc/init.d/mysqld start

Starting MySQL: [ OK ]

Leave a Reply

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

Esse site utiliza o Akismet para reduzir spam. Aprenda como seus dados de comentários são processados.