Backing up and restoring MySQL databases

Back up:
mysqldump -u myuser -p mydb > dump.sql

Restore:
mysql -u myuser -p mydb < dump.sql

2 Comments

  • hi Jesús,

    try instead:
    $mysql -u myuser -p mydb –default_character_set utf8 < dump.sql
    Otherwise, if you use the UTF8 charset, it messes badly the encoding in some platforms.

    By David
    | Thursday, 29 January 2009
  • I’ve never had that problem, but thanks for the tip!

    | Thursday, 29 January 2009

Leave a comment