My Blog has moved to Github Pages

Monday 6 December 2010

Dumping and restoring mysql db's

Dump a db with:

mysqldump -h<host-name-or-ip> -u<username> -p<password> <database-name> > dump.sql

To import, first create the target db, then import the dump with:

mysql -h<host-name-or-ip> -u<username> -p<password> <database-name> < dump.sql

Yep, its that easy.

No comments:

Post a Comment