如何转换latin1_swedish_ci数据到utf8_general_ci? [英] How to convert latin1_swedish_ci data into utf8_general_ci?

查看:335
本文介绍了如何转换latin1_swedish_ci数据到utf8_general_ci?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MySQL数据库,所有表字段排序为

I have a MySQL database with all the table fields collation as

latin1_swedish_ci

它已经存储了近1000条记录,现在我想将所有这些数据转换成

It has almost 1000 of the records already stored and now I want to convert all these data into

utf8_general_ci

。我已将字段排序规则更改为 utf8_general_ci ,但这并不会将所有旧记录 CONVERT 修改为 utf8_general_ci

So that I can display any language content. I have already altered the field collations into utf8_general_ci but this does not CONVERT all the old records into utf8_general_ci

推荐答案

使用它将现有的MySQL数据库从一个字符集编码转换为另一个

Use this to convert existing MySQL database from one charset encoding to another

ALTER DATABASE db_name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

将现有表格从一个字符集编码转换为另一个

Convert existing table from one charset encoding to another

ALTER TABLE db_table CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;

CONVERT()集。检查以供参考

这篇关于如何转换latin1_swedish_ci数据到utf8_general_ci?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆