efureev / yii2-recover-innodb-table
Yii2 component for recovering an innodb table from only an *.ibd file
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 1
Type:yii2-extension
Requires
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-04-29 03:21:22 UTC
README
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
):
- Backup original db (Exp.:
/usr/var/mysql/dbase/
) to other dir (Exp.:/usr/var/mysql/dbase_bak
) - Delete original db
- Create new db with the same name (Exp.:
/usr/var/mysql/dbase/
) - Create same structure as the original
- 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>