Is it possible to remove mysql table collation?

我是研究僧i 提交于 2019-12-11 02:59:38

问题


In my mysql set up, tables and their columns are automatically given utf8_unicode_ci collation. However, there is one table where I want no collation.

How do you set that up? Also, is it possible to remove collation from a table?

Cheers


回答1:


You can change the collation of a column using alter table, for example assuming your column is a VARCHAR(40):

alter table YourTable modify YourColumn varchar(40) collate utf8_bin;

If you don't want any collation at all change the column type to binary, varbinary or blob:

alter table YourTable modify YourColumn varbinary(40);

You can also change the default collation of a table but it only affects columns you create afterwards.



来源:https://stackoverflow.com/questions/19288037/is-it-possible-to-remove-mysql-table-collation

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