It may happen, that you will encounter an encoding problem with loading a MySQL database dump. When moving data between different servers, software versions (like MySQL server or phpmyadmin) will probably be different. And this can be the reason for encoding problems, especially when server admins haven't updated software since long time (I found a server with phpmyadmin version 2.11.0 which was released on 2007-08-21).
The mysqldump command has the set charset option (since very early versions), which adds the
SET NAMES default_character_set
command to the dump output. The following line:
/*!40101 SET NAMES utf8 */;is something that your dump can be missing. It can be found in the very beginning of the dump:
-- phpMyAdmin SQL Dump -- version 2.11.0 -- http://www.phpmyadmin.net -- -- Host: localhost -- Czas wygenerowania: 12 Cze 2011, 12:07 -- Wersja serwera: 5.0.91 -- Wersja PHP: 5.2.3 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */;If you can't find it, add it manually and then load the database dump again. Data encoding should be fine now.
interesting, so migrating pretty old data with pretty old software :D thanks for the tip
ReplyDeletepretty old software can be pretty annoying ;)
Delete