MySQL -- Export, Import, Database, Table

by stilling2006 on 2008-11-15 12:19:20

Here's another PHP code snippet that I treasure very much on my hard drive. This one is about importing and exporting MySQL databases and data tables. It's very suitable for situations where a few people are developing PHP programs together but don't have access to team development tools. Hehe. Yesterday, I also organized some related knowledge about lex. I'll post it when I have time.

1. Export the entire database

`mysqldump -u username -p password database_name > exported_file_name`

Example:

`mysqldump -u wcnc -p 123456 smgp_apps_wcnc > wcnc.sql`