php代码到mysql数据库导出

时间:2010-03-22 11:19:54

标签: php mysql

  

可能重复:
  Best practice: Import mySQL file in PHP; split queries

如何将import * .sql文件导入数据库,并在PHP编码中将db导出到* .sql文件?

1 个答案:

答案 0 :(得分:1)

exec("mysqldump database -u username -p password  > output.sql");

http://ca3.php.net/manual/en/function.exec.php

http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html