SOLVED: mysql table is marked as crashed and should be repaired

Posts regarding the MySQL database server
Post Reply
mister_v
Posts: 188
Joined: Thu Mar 04, 2010 9:19 pm

SOLVED: mysql table is marked as crashed and should be repaired

Post by mister_v »

Hi,

I have the error message:
table is marked as crashed and should be repaired

So how do I do that ?
Last edited by mister_v on Fri Sep 07, 2018 7:26 am, edited 1 time in total.
chris
Site Admin
Posts: 194
Joined: Mon Jul 21, 2008 9:52 am

Re: mysql table is marked as crashed and should be repaired

Post by chris »

The simple answer :

Code: Select all

REPAIR TABLE tablename
if you want more information:
https://dev.mysql.com/doc/refman/8.0/en ... table.html
or
http://dev.mysql.com/doc/refman/5.0/en/ ... epair.html
mister_v
Posts: 188
Joined: Thu Mar 04, 2010 9:19 pm

Re: mysql table is marked as crashed and should be repaired

Post by mister_v »

Thanks that worked.

But now I have another problem.
The repair process crashed.
Probably because of diskspace.

But I have enough free, just /tmp is full.
I assume it uses /tmp, how can I change this?
chris
Site Admin
Posts: 194
Joined: Mon Jul 21, 2008 9:52 am

Re: mysql table is marked as crashed and should be repaired

Post by chris »

Default MySQL repair uses /tmp as temporary dir.
In many system /tmp is now mounted as tmpfs in ram memory,
and is limited in size.

You can change it /etc/mysql/my.cnf
change the tmpdir variable to another dir:

Code: Select all

tmpdir=/var/tmp
and restart MySQL:

Code: Select all

/etc/init.d/mysql restart
mister_v
Posts: 188
Joined: Thu Mar 04, 2010 9:19 pm

Re: SOLVED: mysql table is marked as crashed and should be repaired

Post by mister_v »

Thanks, changing the tmpdir worked.
Post Reply