Loading UTF-8 encoded dump into MySQL

前端 未结 3 1712
无人及你
无人及你 2021-02-06 04:18

I\'ve been pulling my hear out over this problem for a few hours yesterday:

I\'ve a database on MySQL 4.1.22 server with encoding set to \"UTF-8 Unicode (utf8)\" (as rep

3条回答
  •  庸人自扰
    2021-02-06 05:16

    Ugh... ok, seems I found a solution.

    MySQL isn't the culprit here. I did a simple dump and load now, with no changes to the dump.sql script - meaning I left "set names latin2" and tables charsets as they were. Then I switched my original CMSMS installation over to the new database and... it worked correctly. So actually encoding in the database is ok, or at least it works fine with CMSMS installation I had at my old hosting provider (CMSMS apparently does funny things with characters encoding).

    To make it work on my new hosting provider, I actually had to add this line to lib/adodb/drivers/adodb-mysql.inc.php in CMSMS installation:

    mysql_query('set names latin2',$this->_connectionID);

    This is a slightly modified solution from this post. You can find the exact line there as well. So it looks like mysql client configuration issue.

提交回复
热议问题