Created
August 25, 2019 03:08
-
-
Save tamr/e5f3f521e427c82f8aaf3de9298c47d7 to your computer and use it in GitHub Desktop.
[Warning] ./db/table.frm is inconsistent: engine typecode 44, engine name ROCKSDB (45)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$di = new RecursiveDirectoryIterator('/var/lib/mysql/', FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_SELF | FilesystemIterator::SKIP_DOTS); | |
foreach (new RecursiveIteratorIterator($di) as $item => $file) { | |
if ($file->getExtension() !== 'frm') continue; | |
$content = file_get_contents($file->current()->getPathname()); | |
$content = substr(implode(unpack("H*", $content)), 0, 8); | |
if ($content != 'fe010a2c' && $content != 'fe010b2c') continue; | |
$fp = fopen($file->current()->getPathname(), "r+"); | |
fseek($fp, 0x3); | |
$patch = pack("N*", 0x2d120056); | |
fwrite($fp, $patch); | |
fclose($fp); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment