Home > Database > Mysql Tutorial > 大数据量MySQL备份的PHP脚本

大数据量MySQL备份的PHP脚本

WBOY
Release: 2016-06-07 16:33:13
Original
1180 people have browsed it

代码: //备份脚本exec("{$cfg['bak']['mysqldump']} -u {$data['username']} --password={$data['password']} --default-character-set=gbk {$data['dbname']} {$fileName} ");//恢复脚本exec("{$cfg['bak']['mysql']} -u {$data['username']} --password={

代码:

//备份脚本
exec("{$cfg['bak']['mysqldump']} -u {$data['username']} --password={$data['password']}  --default-character-set=gbk {$data['dbname']} > {$fileName} ");
//恢复脚本
exec("{$cfg['bak']['mysql']} -u {$data['username']} --password={$data['password']}  {$data['dbname']} 
<p>直接使用 mysqldump  和 mysql, 这些专业工具的效率绝对是要比PHP写的代码效率高的多<img alt="" border="0" src="http://www.68idc.cn/help/uploads/allimg/150205/11264W936-0.gif">!!</p>


<p>声明: 本文采用 CC BY-NC-SA 3.0 协议进行授权</p><p>转载请注明来源:小景的博客</p><p>本文链接地址:http://www.phpv5.com/blog/archives/445/</p>
    


Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template