求CI后台进行数据库备份还原的例子
如题,在线等 http://wenku.baidu.com/view/978f5b19227916888486d752.htmlMYSQL备份还原语句 不是这个哦 我是需要用CI写的数据库备份 我用手册上面的列子 但是备份却数据库‘损坏 你把原文的错误提示放上来看看。 回复 3# ahkxhyl
CI执行可能受到配置文件的限制。根据错误提示可以对查找问题有帮助 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''<span class=\"Apple-style-span\" style=\"font-family:verdana, arial, helvetica,' at line 1
这么写写看
class Db_manage extends Controller{
function Db_manage()
{
parent::Controller();
$this->load->dbutil();
$this->load->helper('file');
}
function back_up()
{
$backup =& $this->dbutil->backup();
write_file('/uploads/db/', $backup);
$this->load->helper('download');
force_download('mybackup.gz', $backup);
}
} 还原就做个文本域读到文件然后执行SQL就算还原好了。 谢谢 还是错误哦 文本域读到文件 这个怎么做哦 能写给我学习下吗 谢谢 你的数据库什么版本的?