Weird characters after mysqldump export and import on new server

The other day I had to migrate a Wordpress database from one server to the other. I used mysqldump to export the SQL and data from the old server.

Then I used this to import

mysql -uusername -ppassword database < backup.sql

This went fine, but I found I was seeing weird characters in the front end and through phpmysqladmin. The "Collation" on both tables seemed the same.

Then I stumbled on a website that offered this change when importing

mysql -uusername -ppassword --default-character-set=utf8 database < backup.sql

That fixed my troubles... now on to more important things.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <drupal5>, <drupal6>, <javascript>, <php>, <sql>. Beside the tag style "<foo>" it is also possible to use "[foo]".

More information about formatting options