views:

22

answers:

1

Periodically i have one table in my mysql 5.1.41 database that is crashing. After repairing with myisamchk and some server restarts it crashes again. Anybody who has an idea how i can identify what's causing the problem?

+1  A: 

have you checked the mysql log file?

you can enable logging: /etc/my.conf

check if something like the below 2lines exist in the mysqld section

[mysqld]
log-bin
log=/var/log/mysql/mysql.log

how large is your myisam table?

also is there a specific reason you are using myisam tables. I there is no specific reason I would highly recommend switching to InnoDB (InnoDB plugin, or Percona's XtraDB)

InnoDB is a 'crash-safe' storage-engine

Kevin Bakker
hi, the apache server runs under windows. where can i find the logfile here?
ndi
here is the error message Incorrect key file for table '.\database1\banner.MYI'; try to repair it
ndi
you should be looking for the mysql log file. I haven't installed mysql on windows for many years. So the easiest way to find the mysql config file is to do a search on 'my.conf' on your installation drive. It could be possible that on windows that file is named 'my.ini'. I see that you found that error
Kevin Bakker
hi, i found the log file: the error message Incorrect key file for table '.\database1\banner.MYI'; try to repair it. The Table is actually very smal there's just normally just one record in it, which works in php as status variable. just 1 or 0.
ndi
I would switch my tables to InnoDB it will probably solve your problems. First check if you got InnoDB support. On your mysql server Execute the following query: SHOW VARIABLES LIKE 'have_innodb'; if you get a value of 'YES' you can change every table you want to change with the following SQL Query: ALTER TABLE [tablename] ENGINE=InnoDB; (make a backup first)
Kevin Bakker
thanks i'll try that
ndi