Dumping and importing from/to MySQL in an UTF-8 safe way In a nutshell: to avoid your shell character set from messing with imports, use -r to export and SOURCE when importing. Dumping safely # Do not do this, since it might screw up encoding mysqldump -uroot -p database > utf8.dump # this is bad