dbTalk Databases Forums  

mysql tables corrupt question

comp.databases.mysql comp.databases.mysql


Discuss mysql tables corrupt question in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
peter
 
Posts: n/a

Default mysql tables corrupt question - 05-11-2011 , 12:40 AM






Dear All
If I have thousand tables, how can I know which one is corrupted
quickly?
thanks
from Peter (cmk128 (AT) hotmail (DOT) com)

Reply With Quote
  #2  
Old   
Bodo
 
Posts: n/a

Default Re: mysql tables corrupt question - 05-11-2011 , 03:27 AM






Quote:
If I have thousand tables, how can I know which one is corrupted
Hi Peter,

make a mysqldump of all tables?

regards,

Toni

Reply With Quote
  #3  
Old   
Willem Bogaerts
 
Posts: n/a

Default Re: mysql tables corrupt question - 05-11-2011 , 03:32 AM



On 11/05/11 07:40, peter wrote:
Quote:
Dear All
If I have thousand tables, how can I know which one is corrupted
quickly?
thanks
from Peter (cmk128 (AT) hotmail (DOT) com)
If you know that one is corrupt, the error log may be enough to point
you to it. If it is an index running wild, look at the table maintenance
commands (ANALYZE TABLE, OPTIMIZE TABLE, CHECK TABLE). The symptoms of
an index running wild are being unable to insert a new record or
"sudden" foreign key constraint errors for perfectly valid data.

Best regards
--
Willem Bogaerts

Application smith
Kratz B.V.
http://www.kratz.nl/

Reply With Quote
  #4  
Old   
Bodo
 
Posts: n/a

Default Re: mysql tables corrupt question - 05-11-2011 , 04:36 AM



Quote:
make a mysqldump of all tables?

If you want this fast and without creating a file use something like:

mysqldump --user=username --password=secure --all-databases > /dev/null

If you have standard innodb engine running and don't want to disturb other db-operations use:
--single-transaction

regards,

Toni

Reply With Quote
  #5  
Old   
Axel Schwenke
 
Posts: n/a

Default Re: mysql tables corrupt question - 05-11-2011 , 06:08 AM



peter <cmk128 (AT) gmail (DOT) com> wrote:

Quote:
If I have thousand tables, how can I know which one is corrupted quickly?
Corrupted tables are 99.9% a MyISAM problem. If you suspect that a
significant number of your tables is corrupt (i.e. after a crash)
then the best solution would be to stop MySQL (to not start it in
the first place) and run

myisamchk --fast --force $DATADIR/*/*.MYI

this will check all MyISAM tables and repair those that are corrupt.
You want to set the respective options either on the command line or
in my.cnf to have myisamchk make good use of your machines memory.

-> http://dev.mysql.com/doc/refman/5.1/en/myisamchk.html


If the server is already running, then CHECK TABLE is your friend.
In order to check all tables, use the mysqlcheck client tool (which
in turn will run CHECK TABLE and REPAIR TABLE on individual tables).

-> http://dev.mysql.com/doc/refman/5.1/en/mysqlcheck.html


Yet another possibility is to enable automatic recovery for MyISAM
tables. When a (suspectedly) corrupted table is opened, it will
then be checked and repaired automatically.

-> http://dev.mysql.com/doc/refman/5.1/...myisam-recover


XL

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.