douqin6785 2010-09-20 11:38
浏览 158
已采纳

备份mysql数据库并下载为文件

How to backup the mysql database and download it as a .sql file by using PHP Codes

  • 写回答

6条回答 默认 最新

  • dongyashun2559 2010-09-20 12:25
    关注

    A very simple solution would be something like (first example): http://www.php-mysql-tutorial.com/wikis/mysql-tutorials/using-php-to-backup-mysql-databases.aspx

    Naturally this will only make a Data dump of the table.

    What you could do is use this code:

    http://snipplr.com/view/173/mysql-dump/

    What this code does is actually gets a description of the table (i.e its structure), creates all the tables and pushes data. pretty much like any other tool does.

    Then its just a matter of saving it from string to a file (file_put_contents() for instance or something similar, depending on your preference and need)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)

报告相同问题?

悬赏问题

  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿