duanfeigui6655
2014-12-23 08:33
浏览 38
已采纳

我如何在lighttpd中执行mysqldump? 用php

I'm trying to export and import database in lighttpd using php. Mysqldump does not work as is:

$command= 'mysqldump -h localhost -u root -pXXXX db_name > backup.sql';
exec($command);
  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • duandaotuo5542 2015-01-02 19:38
    已采纳

    I was using Palapa Webserver and it turns out the mysqldump application is not included. Sorry, should have checked this first and I also should have been clear that I was using Palapa Webserver.

    I just ended up using import and export functions that I found.

    Import:

    how to import .sql file in mysql database using php

    Export:

    http://davidwalsh.name/backup-mysql-database-php

    Thanks

    已采纳该答案
    评论
    解决 无用
    打赏 举报
  • dourang8305 2014-12-23 08:37

    If you want to download it from browser just use passthru

    passthru('mysqldump -h localhost -u root -pXXXX db_name');
    
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题