Восстановление базы данных

Главные вкладки

Аватар пользователя Jentix Jentix 6 ноября 2018 в 13:03

Здравствуйте! Поставили задачу восстановить базу данных, которая ( как я предполагаю, после неудачного обновления mysql до 5.7) перестала нормально функционировать. Все что удалось получить - таблицы в формате .frm, ib_logfile1, mysql_upgrade_info - в котором указана версия 5.5.46 и файл ibdata1 размером в 1.5 гб.
При открытии любой таблицы - 1146 - Table does not exist. При входе в phpmadmin и выборе этой базы интерфейс вобще отказывается работать и выбрасывает на окно входа, иногда при этом рисуя следующее:

Warning in ./libraries/dbi/DBIMysqli.class.php#261
 mysqli_query(): MySQL server has gone away

Backtrace

./libraries/dbi/DBIMysqli.class.php#261: mysqli_query(
object,
string 'SHOW INDEXES FROM cache FROM dak',
integer 0,
)
./libraries/DatabaseInterface.class.php#244: PMA_DBI_Mysqli->realQuery(
string 'SHOW INDEXES FROM cache FROM dak',
object,
integer 0,
)
./libraries/navigation/Nodes/Node_Table.class.php#114: PMA_DatabaseInterface->tryQuery(string 'SHOW INDEXES FROM cache FROM dak')
./libraries/navigation/NavigationTree.class.php#519: Node_Table->getPresence(string 'indexes')
./libraries/navigation/NavigationTree.class.php#444: PMA_NavigationTree->_addTableContainers(
object,
integer 0,
string '',
integer 0,
)
./libraries/navigation/NavigationTree.class.php#297: PMA_NavigationTree->_buildPathPart(
array,
string 'tables',
integer 0,
string '',
integer 0,
)
./libraries/navigation/NavigationTree.class.php#867: PMA_NavigationTree->_buildPath()
./libraries/navigation/Navigation.class.php#50: PMA_NavigationTree->renderPath()
./navigation.php#75: PMA_Navigation->getDisplay()
Warning in ./libraries/dbi/DBIMysqli.class.php#261
 mysqli_query(): Error reading result set's header

Backtrace

./libraries/dbi/DBIMysqli.class.php#261: mysqli_query(
object,
string 'SHOW INDEXES FROM cache FROM dak',
integer 0,
)
./libraries/DatabaseInterface.class.php#244: PMA_DBI_Mysqli->realQuery(
string '
SHOW INDEXES FROM cache FROM dak',
object,
integer 0,
)
./libraries/navigation/Nodes/Node_Table.class.php#114: PMA_DatabaseInterface->tryQuery(string '
SHOW INDEXES FROM cache FROM dak')
./libraries/navigation/NavigationTree.class.php#519: Node_Table->getPresence(string '
indexes')
./libraries/navigation/NavigationTree.class.php#444: PMA_NavigationTree->_addTableContainers(
object,
integer 0,
string '
',
integer 0,
)
./libraries/navigation/NavigationTree.class.php#297: PMA_NavigationTree->_buildPathPart(
array,
string '
tables',
integer 0,
string '
',
integer 0,
)
./libraries/navigation/NavigationTree.class.php#867: PMA_NavigationTree->_buildPath()
./libraries/navigation/Navigation.class.php#50: PMA_NavigationTree->renderPath()
./navigation.php#75: PMA_Navigation->getDisplay()

Все что мне удалось сделать, это восстановить структуру таблиц, используя вот этот нехитрый способ:

Вернуть дату так и не получилось.
Если просто создать базу и залить туда все эти файлы, mysql крашится и не стартует. Лог:

181106 12:01:06 [Note] c:\ospanel\modules\database\MySQL-5.5-x64\bin\mysqld.exe (mysqld 5.5.57) starting as process 7416 ...
181106 12:01:06 [Note] Plugin 'FEDERATED' is disabled.
181106 12:01:06 InnoDB: The InnoDB memory heap is disabled
181106 12:01:06 InnoDB: Mutexes and rw_locks use Windows interlocked functions
181106 12:01:06 InnoDB: Compressed tables use zlib 1.2.3
181106 12:01:06 InnoDB: Initializing buffer pool, size = 128.0M
181106 12:01:06 InnoDB: Completed initialization of buffer pool
181106 12:01:06 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
181106 12:01:06  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...
181106 12:01:06  InnoDB: Assertion failure in thread 12200 in file fsp0fsp.c line 2102
InnoDB: Failing assertion: inode
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.5/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
10:01:06 UTC - mysqld got exception 0x80000003 ;
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=2097152
max_used_connections=0
max_threads=30
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 118072 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 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...
7ff682641e92    mysqld.exe!my_thread_name()
6e925f41    MSVCR90.dll!raise()
6e92b846    MSVCR90.dll!abort()
7ff6826e03b9    mysqld.exe!my_osmaperr()
7ff6826e0687    mysqld.exe!my_osmaperr()
7ff6826a737e    mysqld.exe!my_osmaperr()
7ff6826fcc36    mysqld.exe!my_osmaperr()
7ff6826828d5    mysqld.exe!my_osmaperr()
7ff68267abf8    mysqld.exe!my_osmaperr()
7ff682444366    mysqld.exe!?ha_initialize_handlerton@@YAHPEAUst_plugin_int@@@Z()
7ff68243d722    mysqld.exe!?plugin_lock_by_name@@YAPEAUst_plugin_int@@PEAVTHD@@PEBUst_mysql_lex_string@@H@Z()
7ff682441f09    mysqld.exe!?plugin_init@@YAHPEAHPEAPEADH@Z()
7ff68242cb70    mysqld.exe!handle_shutdown()
7ff68242d722    mysqld.exe!?win_main@@YAHHPEAPEAD@Z()
7ff68242db90    mysqld.exe!?mysql_service@@YAHPEAX@Z()
7ff68242deb3    mysqld.exe!?mysqld_main@@YAHHPEAPEAD@Z()
7ff6827d533a    mysqld.exe!my_mb_ctype_mb()
7ffc005b3034    KERNEL32.DLL!BaseThreadInitThunk()
7ffc01691461    ntdll.dll!RtlUserThreadStart()
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.

Буду рад любой помощи!
Все файлы по ссылке - https://dropmefiles.com/ofXUj

Комментарии

Аватар пользователя bsyomov bsyomov 8 ноября 2018 в 16:43

У вас битый ibdata1. В сообщении об ошибке довольно подробно описано, что делать дальше, и даже есть ссылка на документацию (http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html).

Надо пробовать запускать mysql с различными уровнями восстановления, начиная с минимальных, и пробовать сделать дамп данных. Если повезёт, то на одном из низких уровней получиться дамп полностью снять. Если нет, надо пробовать снимать дампы отдельных таблиц, и если повезёт, то получится достать большую часть данных.

Всё это крайне желательно делать на той же операционной системе, и той же версии mysql, которой эти данные изначально принадлежали, и с теми же настройками, как минимум, с тем же размером логов innodb. Так что надо будет взять какой-нибудь virtualbox и накатить в нём соответствующий дистрибутив, с нужным mysql для этой работы.