Calendar

<<February>>
MoTuWeThFrSaSu
  12345
6789101112
13141516171819
20212223242526
272829    

Importing mysql dumps from phpMyAdmin

Mon, 30 Mar 2009 16:12 - Daniel - Other - Comments (0)


Every time I move a website from a shared hosting account to my own server I have to export the databases with phpMyAdmin. But since these dumps can get pretty big, it's not a good idea to import then with phpMyAdmin. Usually you use the command line mysql client. But here comes the problem: Database dumps from phpMyAdmin are usually UTF8, but mysql expects ISO-8859-1 or something else and special chars like ä or ü end up as weird signs.

I've done some crazy shit before to fis this, like manually replacing those occurences, or converting the dump with iconv. I guess I should have read the man page more carefully, because mysql has an option to tell it which charset your file is in: default_character_set

Use mysql --default-character-set utf8 < dump.sql to im import your dump and everything works fine.


Tags: mysql charset character set phpmyadmin



1