efureev/yii2-recover-innodb-table

Yii2 component for recovering an innodb table from only an *.ibd file

v0.1.2 2016-06-01 23:02 UTC

This package is auto-updated.

Last update: 2024-03-29 03:13:19 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --dev --prefer-dist efureev/yii2-recover-innodb-table:"~0.1.0"

or add

"efureev/yii2-recover-innodb-table": "~0.1.0"

to the require-dev section of your composer.json.

Usage

To use this extension, simply add the following code in your application configuration (console.php):

'controllerMap' => [
    'utilsdb' => [
        'class' => 'efureev\utilsdb\recoverinnodb\RecoverController',
    ],
],

Recovering (Exp., database name dbase):

  1. Backup original db (Exp.: /usr/var/mysql/dbase/) to other dir (Exp.: /usr/var/mysql/dbase_bak)
  2. Delete original db
  3. Create new db with the same name (Exp.: /usr/var/mysql/dbase/)
  4. Create same structure as the original
  5. Run script: ./yii utilsdb/repair-table /usr/var/mysql/dbase /usr/var/mysql/dbase_bak
# to start recover db
php yii utilsdb/repair-table <original> <backup>