1

Last week I migrated my db in another platform. I did a mysqldump export from phpmyadmin panel and then I imported it in a new platform using the bigdump script. The sql dump file that I have imported was originally stored in a db that was setting in this manner:

MySQL charset: UTF-8 Unicode (utf8)
MySQL connection collation: utf8_unicode_ci

I exported the db choosing utf8 character set but if I look inside the mysqldump file for every table appears: DEFAULT CHARSET=latin1

Now I have a problem with the accented letter (like à, è, ò, ì) that are displayed like ò , Ã...etc. For manage my new db I use MySQL Workbench and if i prompt: show variables like 'char%'; I see that all the values are set in utf8. How can I solve the problem? I'm not a Mysql and db expert!

4

2 回答 2

0

尽管您提到了 utf8 设置,但您的表似乎使用 latin1。所以你有几个选择:

  1. 按原样获取创建的转储并使用 latin1 连接字符集(不是 utf8)将其发送到服务器。但是,这将创建具有 latin1 字符集的表,因为它们在源服务器上。
  2. 如果您有可以执行此操作的工具,请将转储转换为 utf-8。不过,您也必须在脚本中更改表的字符集设置。
  3. 将您的表转换为 utf8 并再次转储。
  4. 合并 1 + 3,但转换您的目标表。如果您无法更改源表,则很有用。

您是否真的尝试过 MySQL Workbench 将转储恢复到您的新服务器?我很确定它应该能够使用 latin1 编码的备份来处理这种情况。请参阅服务器管理部分 -> 数据导入/恢复。

于 2013-01-25T08:14:35.460 回答
0

You can try changing the current character set of a table to the original:

alter table TABLE_NAME convert to character set utf8 collate utf8_unicode_ci;
于 2013-01-24T09:36:30.663 回答