ahkxhyl 发表于 2010-10-15 14:05:59

求CI后台进行数据库备份还原的例子

如题,在线等

sonic 发表于 2010-10-15 14:49:17

http://wenku.baidu.com/view/978f5b19227916888486d752.html

MYSQL备份还原语句

ahkxhyl 发表于 2010-10-15 14:56:36

不是这个哦 我是需要用CI写的数据库备份 我用手册上面的列子 但是备份却数据库‘损坏

sonic 发表于 2010-10-15 15:00:14

你把原文的错误提示放上来看看。

sonic 发表于 2010-10-15 15:05:26

回复 3# ahkxhyl

CI执行可能受到配置文件的限制。根据错误提示可以对查找问题有帮助

ahkxhyl 发表于 2010-10-15 15:19:56

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

sonic 发表于 2010-10-15 15:47:08

这么写写看
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);
    }
}

sonic 发表于 2010-10-15 15:49:13

还原就做个文本域读到文件然后执行SQL就算还原好了。

ahkxhyl 发表于 2010-10-15 16:03:52

谢谢 还是错误哦 文本域读到文件 这个怎么做哦 能写给我学习下吗 谢谢

sonic 发表于 2010-10-15 16:11:21

你的数据库什么版本的?
页: [1] 2 3 4
查看完整版本: 求CI后台进行数据库备份还原的例子