标签: php mysql
可能重复: Best practice: Import mySQL file in PHP; split queries
如何将import * .sql文件导入数据库,并在PHP编码中将db导出到* .sql文件?
答案 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