MySQL Database Export and Import
Submitted by justin on Wed, 02/13/2008 - 16:40
Here's a couple quick tips to help you export and import a MySQL database. This is great when you're looking to move servers or just make backups of the data. I know lots of people use phpMyAdmin to manage their MySQL servers (as do I). But sometimes you need to get at large amounts of data. Web based apps won't cut it. You'll need shell access (ssh).
Exporting the MySQL Database mysqldump -u USERNAME -pPASSWORD DATABASE_NAME > EXPORT_FILE.sqlNote the there is no space between the -p and the actual password. You may also omit the password. MySQL will prompt you for it.
Importing the MySQL Database mysql -u USERNAME -pPASSWORD DATABASE_NAME < IMPORT_FILE.sqlAgain you can omit the password here.