SQLinfo.ru - Все о MySQL

Форум пользователей MySQL

Задавайте вопросы, мы ответим

Вы не зашли.

#1 06.04.2010 23:19:12

cosmo
Участник
Зарегистрирован: 06.04.2010
Сообщений: 3

восстановление InnoDB из файлов

Умер диск с виндой, на котором стояла MySQL. Бэкапов нет. Папку data удалось вытащить. Теперь пытаюсь поднять всё на новой винде.

Для начала в новую папку дата копирую только папку с названием бд airbase (в ней файлы frm с названиями таблиц).

Файлы
ib_logfile0
ib_logfile1
ibdata1
пока остаются от нулевой свежеустановленной MySQL.

В таком виде сервер стартует, БД и таблицы видно, но при попытке обращения к любой таблице вылетает Table 'airbase.название_таблицы' doesn't exist.

Теперь заменяю и файлы
ib_logfile0
ib_logfile1
ibdata1
Не стартует - в логах:
InnoDB: Error: log file .\ib_logfile0 is of different size 0 178257920 bytes
InnoDB: than specified in the .cnf file 0 25165824 bytes!

Меняю innodb_log_file_size на 170М.

Не стартует. Теперь в логе такая простыня:

100406 23:08:11 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
100406 23:08:12  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Page directory corruption: infimum not pointed to
100406 23:08:12  InnoDB: Page dump in ascii and hex (16384 bytes):
len 16384; hex <<тут много нулей>>; asc<<тут много пробелов>>;InnoDB: End of page dump
100406 23:08:14  InnoDB: Page checksum 1575996416, prior-to-4.0.14-form checksum 1371122432
InnoDB: stored checksum 0, prior-to-4.0.14-form stored checksum 0
InnoDB: Page lsn 0 0, low 4 bytes of lsn at page end 0
InnoDB: Page number (if stored to page already) 0,
InnoDB: space id (if created with >= MySQL-4.1.1 and stored already) 0
InnoDB: Page may be a freshly allocated page
InnoDB: Page directory corruption: supremum not pointed to
100406 23:08:14  InnoDB: Page dump in ascii and hex (16384 bytes):
len 16384; hex <<тут много нулей>>; asc<<тут много пробелов>>;InnoDB: End of page dump
100406 23:08:15  InnoDB: Page checksum 1575996416, prior-to-4.0.14-form checksum 1371122432
InnoDB: stored checksum 0, prior-to-4.0.14-form stored checksum 0
InnoDB: Page lsn 0 0, low 4 bytes of lsn at page end 0
InnoDB: Page number (if stored to page already) 0,
InnoDB: space id (if created with >= MySQL-4.1.1 and stored already) 0
InnoDB: Page may be a freshly allocated page
100406 23:08:15InnoDB: Error: trying to access a stray pointer 83A83FF8
InnoDB: buf pool start is at 03A74000, end at 06974000
InnoDB: Probable reason is database corruption or memory
InnoDB: corruption. If this happens in an InnoDB database recovery, see
InnoDB: http://dev.mysql.com/doc/refman/5.1/en/ … overy.html
InnoDB: how to force recovery.
100406 23:08:15  InnoDB: Assertion failure in thread 2792 in file G:\mysql-5.1.45-winbuild\mysql-community-nt-5.1.45-build\storage\innobase\include\buf0buf.ic line 264
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.1/en/ … overy.html
InnoDB: about forcing recovery.
100406 23:08:15 - mysqld got exception 0xc0000005 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=26214400
read_buffer_size=65536
max_used_connections=0
max_threads=100
threads_connected=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 58231 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
005EE050    mysqld.exe!buf_frame_align()[buf0buf.ic:264]
005D387C    mysqld.exe!page_dir_slot_get_rec()[page0page.ic:503]
0061E896    mysqld.exe!page_cur_search_with_match()[page0cur.c:351]
005D9B4C    mysqld.exe!btr_cur_search_to_nth_level()[btr0cur.c:521]
00603640    mysqld.exe!btr_pcur_open()[btr0pcur.ic:494]
00604316    mysqld.exe!btr_pcur_open_on_user_rec()[btr0pcur.c:550]
005F9D9A    mysqld.exe!dict_load_indexes()[dict0load.c:610]
005FA107    mysqld.exe!dict_load_sys_table()[dict0load.c:1015]
0060F538    mysqld.exe!dict_boot()[dict0boot.c:389]
005C214A    mysqld.exe!innobase_start_or_create_for_mysql()[srv0start.c:1521]
005B0138    mysqld.exe!innobase_init()[ha_innodb.cc:1973]
0047E818    mysqld.exe!ha_initialize_handlerton()[handler.cc:435]
00429673    mysqld.exe!plugin_initialize()[sql_plugin.cc:1014]
0042D244    mysqld.exe!plugin_init()[sql_plugin.cc:1238]
00418121    mysqld.exe!init_server_components()[mysqld.cc:3950]
004187E1    mysqld.exe!win_main()[mysqld.cc:4419]
00418B1B    mysqld.exe!mysql_service()[mysqld.cc:4597]
0065DB33    mysqld.exe!_callthreadstart()[thread.c:293]
0065DBCC    mysqld.exe!_threadstart()[thread.c:275]
76551194    kernel32.dll!BaseThreadInitThunk()
7731B3F5    ntdll.dll!RtlInitializeExceptionChain()
7731B3C8    ntdll.dll!RtlInitializeExceptionChain()
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.

Добавление в конец my.ini строки innodb_force_recovery=6 ничего не меняет.

Прошу помощи.

Неактивен

 

#2 07.04.2010 00:32:25

paulus
Администратор
MySQL Authorized Developer and DBA
Зарегистрирован: 22.01.2007
Сообщений: 6756

Re: восстановление InnoDB из файлов

Попробуйте воспользоваться InnoDB tools:
http://sqlinfo.ru/forum/viewtopic.php?id=2438

Боюсь, что в этой ситуации ничего больше не посоветуешь...

Неактивен

 

#3 07.04.2010 08:29:17

cosmo
Участник
Зарегистрирован: 06.04.2010
Сообщений: 3

Re: восстановление InnoDB из файлов

paulus написал:

Попробуйте воспользоваться InnoDB tools:
http://sqlinfo.ru/forum/viewtopic.php?id=2438

Боюсь, что в этой ситуации ничего больше не посоветуешь...

Спасибо! Я правильно понимаю, что для InnoDB tools надо линукс ставить и там уже копаться?

Неактивен

 

#4 07.04.2010 20:15:04

paulus
Администратор
MySQL Authorized Developer and DBA
Зарегистрирован: 22.01.2007
Сообщений: 6756

Re: восстановление InnoDB из файлов

Ну, читать бинарные файлы можно и в windows... и там, и там операция неблагодарная
и нехорошая sad

Неактивен

 

#5 13.04.2010 23:19:48

cosmo
Участник
Зарегистрирован: 06.04.2010
Сообщений: 3

Re: восстановление InnoDB из файлов

Как я понял из описания тут: http://www.chriscalender.com/?p=49

сначала InnoDB Tools должен с помощью пёрловского скрипта составить себе представление о структуре таблиц с помощью sql-запроса к базе.

Но у меня нет работающей базы. У меня есть набор с frm файлами таблиц и файлы ib_logfile0, ib_logfile1, ibdata1.

На форумах все советуют такой подход: создавать в MySQL бд с тем же именем, что и была и там таблицы с теми же именами. Потом заменить frm файлы таблиц на старые. Таким образом получится восстановить структуру таблиц.

Но у меня так не получается.
Перловский скрипт выдаёт:
DBD::mysql::st execute failed: Lost connection to MySQL server during query at create_defs.pl line 256.
DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at create_defs.pl line 257.

Нельзя ли как-то подругому вытащить структуру таблиц из frm файлов? Без их подмены в MySQL. Файлы же есть, у них есть какой-то формат. Должна же быть возможность их расковырять.

Неактивен

 

#6 13.04.2010 23:56:46

paulus
Администратор
MySQL Authorized Developer and DBA
Зарегистрирован: 22.01.2007
Сообщений: 6756

Re: восстановление InnoDB из файлов

Ну, по формату frm есть статья: http://forge.mysql.com/wiki/MySQL_Inter … le_Formats

С другой стороны, frm прочитать можно и с помощью MySQL:
1. Создаем любую табличку InnoDB;
2. Выполняем FLUSH TABLES;
3. Заменяем файлик .frm на тот, который надо прочитать;
4. Выполняем SHOW CREATE TABLE.

Неактивен

 

Board footer

Работает на PunBB
© Copyright 2002–2008 Rickard Andersson