网站地图    收藏   

主页 > 后端 > codeigniter >

CodeIgniter框架备份数据库

来源:未知    时间:2015-04-22 09:49 作者:xxadmin 阅读:

[导读] 导出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-...

导出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('backup.zip',$backup);
 

自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习

京ICP备14009008号-1@版权所有www.zixuephp.com

网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com

添加评论