是否可以删除mysql表排序规则?

问题描述:

在我的mysql设置中,表及其列自动被赋予utf8_unicode_ci排序规则.但是,有一张表我不需要排序规则.

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?

欢呼

您可以使用alter table更改列的排序规则,例如,假设您的列是VARCHAR(40):

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;

如果您根本不希望使用任何排序规则,请将列类型更改为二进制,varbinary或blob:

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.