Domanda

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

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top