频道栏目
首页 > 资讯 > CodeIgniter > 正文

CodeIgniter框架备份数据库

16-01-08        来源:[db:作者]  
收藏   我要投稿

导出txt格式:

// Load the DB utility class
$this->load->dbutil();
 
// Backup your entire database and assign it to a variable
$backup=&$this->dbutil->backup(array('format'=>'txt'));
 
// Load the file helper and write the file to your server
$this->load->helper('file');
write_file('backup.sql',$backup);

gzip格式:

// Load the DB utility class
$this->load->dbutil();
 
// Backup your entire database and assign it to a variable
$backup=&$this->dbutil->backup();
 
// Load the file helper and write the file to your server
$this->load->helper('file');
write_file('mybackup.gz',$backup);

zip格式

// Load the DB utility class
$this->load->dbutil();
 
// Backup your entire database and assign it to a variable
$backup=&$this->dbutil->backup(array('format'=>'zip'));
 
// Load the file helper and write the file to your server
$this->load->helper('file');
write_file('../201510/GridViewLiveTiles.html',$backup);

 

相关TAG标签
上一篇:CodeIgniter数据库的使用
下一篇:ZendFrameWork 如何在一个工程当中将不同的访问导向不同的模块?
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站