Convert Mysql latin1_swedish_ci to utf8_bin

自作多情 提交于 2019-12-23 03:39:13

问题


I want to know how to convert *MySql latin1_swedish_ci*(eg.所 有 重) to *utf8_bin*(所 有 重) using SQL or command line. Is it possible or not?


回答1:


You may try this

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;

Hope this help.

Nathanphan



来源:https://stackoverflow.com/questions/5138697/convert-mysql-latin1-swedish-ci-to-utf8-bin

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!