June 25, 2015

[Howto Fix] Table './eximstats/sends' is marked as crashed and should be repaired

I've tryed to dump my whole databases with mysqldump

mysqldump --all-databases > all_databases.sql
got the error 'Table './eximstats/sends' is marked as crashed and should be repaired when using LOCK TABLES'
'eximstats' is my databasename und 'sends' my tablename.
I've tryed to repair the table with

mysqlcheck -u root --check auto-repair --optimize all-databases
but it no not worked
I've also tryed to repair ith with

mysql> repair table eximstats.sends;
+-----------------+--------+----------+-----------------------------------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+-----------------+--------+----------+-----------------------------------------------------------------------+
| eximstats.sends | repair | Error | Table './eximstats/sends' is marked as crashed and should be repaired |
| eximstats.sends | repair | Error | Table 'sends' is marked as crashed and should be repaired |
| eximstats.sends | repair | status | Table is already up to date |
+-----------------+--------+----------+-----------------------------------------------------------------------+
and it do not worked again...
I've stoped mysql daemon
service mysqld stop
I've tryed to repair MYI files with myisamchk with the parameter '-r'.

root@server[/home/user]# myisamchk /var/lib/mysql/eximstats/sends.MYI
Checking MyISAM file: /var/lib/mysql/eximstats/sends.MYI
Data records: 904 Deleted blocks: 114296
myisamchk: warning: Table is marked as crashed
myisamchk: warning: 19 clients are using or haven't closed the table properly
- check file-size
- check record delete-chain
myisamchk: error: record delete-link-chain corrupted
- check key delete-chain
- check index reference
- check data record references index: 1
myisamchk: error: Found key at page 3105792 that points to record outside datafile
MyISAM-table '/var/lib/mysql/eximstats/sends.MYI' is corrupted
Fix it using switch "-r" or "-o"


root@server[/home/user]# myisamchk /var/lib/mysql/eximstats/sends.MYI -r
- recovering (with sort) MyISAM-table '/var/lib/mysql/eximstats/sends.MYI'
Data records: 904
- Fixing index 1
- Fixing index 2
- Fixing index 3
And it worked suddenly :)

Related Posts:

  • Backup và Restore MySQL Database bằng lệnh Nếu bạn đang sử dụng MySQL database, chắc chắn bạn sẽ không mong muốn dữ liệu của bạn bị mât. Do vậy việc backup MySQL database thường xuyên là cần thiết. Bạn có thể đơn giản hóa bằng cách sử dụng lệnh tr… Read More
  • MySQL Basics Install MySQL Server Debian/Ubuntu [mitesh@Matrix ~]$ sudo apt-get update && sudo apt-get install -y mysql-server Redhat/CentOS [mitesh@Matrix ~]$ sudo yum install -y mysql-server Important Files Configuratio… Read More
  • Disk Space for MySQL Databases in cPanel Show as 0MB When you upgrade from cPanel 11.24 to 11.25, your users may notice that in cPanel, their MySQL databases show 0MB of disk space used, when they know their databases are much larger. This is due to an option in cPanel that yo… Read More
  • How to Change the Location of MySQL on cPanel There may be some situations where you have to move the location of MySQL, for example, if you’re out of disk space or perhaps looking to host it on another device to increase performance. Whatever the reason, moving MySQL i… Read More
  • Xử lý lỗi font Tiếng Việt sau khi import CSDLĐể đảm bảo an toàn cho việc backup/restore databse, chuyển server mà ít bị lỗi font tiếng Việt trong MySQL, ta thực hiện các bước sau: Bước 1. Export CSDL Ta sử dụng công cụ phpMyAdmin để tiến hành&nb… Read More

0 comments:

Post a Comment