Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yanue/dbmanage
a php class for mysql backup and restore
https://github.com/yanue/dbmanage
backend dbmanager mysql restore
Last synced: 2 months ago
JSON representation
a php class for mysql backup and restore
- Host: GitHub
- URL: https://github.com/yanue/dbmanage
- Owner: yanue
- Created: 2012-10-27T03:54:29.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2016-11-18T02:43:00.000Z (about 8 years ago)
- Last Synced: 2024-10-14T16:38:31.900Z (3 months ago)
- Topics: backend, dbmanager, mysql, restore
- Language: PHP
- Size: 199 KB
- Stars: 44
- Watchers: 9
- Forks: 31
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Dbmanage
========
* @author yanue
* @copyright yanue.net
* @link http://yanue.net/archives/174.html
* @version 1.1
* 创建时间: 2012年5月21日
* 说明:分卷文件是以_v1.sql为结尾(20120522021241_all_v1.sql)
* 功能:实现mysql数据库分卷备份,选择表进行备份,实现单个sql文件及分卷sql导入
* 更新时间: 2012年10月6日
### 更新说明:1.去除sql导入的时候排除sql文件里面的注释'-- ' 从而解决sql中单双引号不能导入
2.单行读取后的sql直接执行,避免重新将sql语句组合到数组中再从数组中读取导入sql,提高效率
### 使用方法:####1. 数据库备份(导出)
//分别是主机,用户名,密码,数据库名,数据库编码
$db = new DBManage ( 'localhost', 'root', 'root', 'test', 'utf8' );
// 参数:备份哪个表(可选),备份目录(可选,默认为backup),分卷大小(可选,默认2000,即2M)
$db->backup ();
####2. 数据库恢复(导入)//分别是主机,用户名,密码,数据库名,数据库编码
$db = new DBManage ( 'localhost', 'root', 'root', 'test', 'utf8' );
//参数:sql文件
$db->restore ( './backup/20120516211738_all_v1.sql');