Повредились таблицы MYD, как их восстановить?
Восстановление с помощью myisamchk -r * не помогает, таблицы MYI проверяет нормально, а на MYD ругается: "doesn`t have a correct index definition. You need to recreate it before you can do a repair."
На некоторые MYD ругается так: "myisamchk: error: -1 when opening MyISAM-table "/..../....../xxx.MYD"
Как исправить сей хаос?
(FreeBSD 4.7, NetUP UTM 4.0 [1 +update 24 sep 2003], MySQL 3.23.48.)
Проблема с таблицами MYD
надо удалить индексы и пересоздать заново.doesn`t have a correct index definition. You need to recreate it before you can do a repair."
http://dev.mysql.com/doc/mysql/ru/create-index.html
починил.
вообщем сначала так
Stage 3: Difficult repair
You should reach this stage only if the first 16KB block in the index file is destroyed or contains incorrect information, or if the index file is missing. In this case, it's necessary to create a new index file. Do so as follows:
1. Move the data file to some safe place.
2. Use the table description file to create new (empty) data and index files:
shell> mysql db_name
mysql> SET AUTOCOMMIT=1;
mysql> TRUNCATE TABLE tbl_name;
mysql> quit
If your version of MySQL doesn't have TRUNCATE TABLE, use DELETE FROM tbl_name instead.
3. Copy the old data file back onto the newly created data file. (Don't just move the old file back onto the new file; you want to retain a copy in case something goes wrong.)
потом так
mysql>
CHECK TABLE table_name;
REPAIR TABLE table_name;
вообщем сначала так
Stage 3: Difficult repair
You should reach this stage only if the first 16KB block in the index file is destroyed or contains incorrect information, or if the index file is missing. In this case, it's necessary to create a new index file. Do so as follows:
1. Move the data file to some safe place.
2. Use the table description file to create new (empty) data and index files:
shell> mysql db_name
mysql> SET AUTOCOMMIT=1;
mysql> TRUNCATE TABLE tbl_name;
mysql> quit
If your version of MySQL doesn't have TRUNCATE TABLE, use DELETE FROM tbl_name instead.
3. Copy the old data file back onto the newly created data file. (Don't just move the old file back onto the new file; you want to retain a copy in case something goes wrong.)
потом так
mysql>
CHECK TABLE table_name;
REPAIR TABLE table_name;