maowenke/mysql

There is no license information available for the latest version (dev-master) of this package.

简单的mysql导入导出,可筛选数据

dev-master 2021-09-04 22:38 UTC

This package is not auto-updated.

Last update: 2024-06-10 16:57:44 UTC


README

提供Mysql导入导出等基础功能,需要php>=5.4,依赖pdo_mysql扩展,后续也许会完善增强

已加入composer豪华午餐

安装

composer require maowenke/mysql dev-master

使用

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();
$bool = $back_tool->setTables(['ea_system_ces'])->setOutputPath(public_path())->setWithData(true)->dump(['where id > 10']);

/* filepath 是一个数组,第一个元素是相对路径,第二个元素是绝对路径 */

$restore = new \jayfun\mysqlTool\Restore($database);
$restore->restore($filepath[0]);