How about your disk space? I had a similar problem on a large table and
it ended up being caused by filling up the disk.
Steve Musumeche
CIO, Internet Retail Connection
[EMAIL PROTECTED]
Octavian Rasnita wrote:
From: "Steve Edberg" <[EMAIL PROTECTED]>
Sometimes I see that some tables from my database get corrupted. Why
does this happpen and how can I avoid it?
It is not hard to go and use "repair table" but it seems that in
this way some records could be deleted and this is not ok.
If I want to have a very secure database, can I use MySQL? I hope
the answer won't be that I need to make backups regularily.
You'll have to give us some more information...at least:
* What MySQL version, OS platform, and file system used for database?
I am using MySQL 5, under Fedora Core 4, installed with its default
options.
* Does this happen at a regular time, or apparently randomly?
It happends apparently randomly. Sometimes I just see that the
programs are not working. Sometimes I can do some simple queries in
the table with problems (like select count(*) from table_name), and
the query works fine, but only when trying some more complex queries I
can find that the table is corrupt and I need to fix it.
Sometimes after fixing the table no records are deleted, but sometimes
one or more records are deleted after fixing it.
* Does this happen to the same tables all the time, or is that random
as well?
I found that it happends in more tables, but especially with one of
them. That table has more than 2 million records and it is a MyISAM
table. Should I use InnoDB instead? (Or another storage system?)
That table is updated by a single program which runs continuously a
few hours every day, and the program add (just addings and no updates)
aproximately 10000 records in those few hours... so they are not very
very many.
But other programs query that table very often.
* Is this a precompiled binary from MySQL or did you build it yourself?
It is a precompiled version from MySQL.
I could see that if you compiled it yourself against some buggy
libraries you could have problems; perhaps a cronjob is doing some
copy/restore process on the underlying files without shutting mysql
down or flushing logs; perhaps a lot of things...more information is
needed.
I have also seen (in most of the tables if not all) that after using
"check table table_name" for the first time, I receive the message
that the table was not closed by a few processes (from 2 to 6
processes). If I use that query a second time, I receive the message
that the table is ok, and that message doesn't appear again.
It has been my experience (on Windows NT, Solaris and Linux
platforms) that MySQL has been one of the more reliable programs out
there. Even after system crashes I haven't lost any data; a repair
table and index rebuild fixed things.
Yes in some cases it is the same for me, but after reparing a table,
sometimes it tells me that some records were deleted because before
that repair query the number of records reported is bigger.
steve
Thank you.
Octavian
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]