# MySQL备份还原类库 **Repository Path**: dlm2015/mysql-tool ## Basic Information - **Project Name**: MySQL备份还原类库 - **Description**: 提供Mysql导入导出等基础功能,需要php>=5.4,依赖pdo_mysql扩展,后续也许会完善增强 - **Primary Language**: PHP - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2017-12-13 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # MySQL备份还原类库 提供Mysql导入导出等基础功能,需要`php>=5.4`,依赖`pdo_mysql`扩展,后续也许会完善增强 已加入composer豪华午餐 安装 ```$xslt composer require jayfun/mysql-tool dev-master ``` 使用 ```$xslt require '/vendor/autoload.php'; $database = [ 'username' => 'root', 'password' => 'root', 'host' => '127.0.0.1:3306', 'database' => 'table', ]; $back_tool = new jayfun\mysqlTool\Backup($database); $filepath = $back_tool->setWithData(true)->setFilename('backup')->dump(); /* filepath 是一个数组,第一个元素是相对路径,第二个元素是绝对路径 */ $restore = new \jayfun\mysqlTool\Restore($database); $restore->restore($filepath[0]); ```