Possible Duplicate:
Best practice: Import mySQL file in PHP; split queries
How to import import *.sql file into dat开发者_如何学Goabase and export db to *.sql file in php coding?
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
精彩评论