是否可以删除mysql表排序规则? [英] Is it possible to remove mysql table collation?

查看:115
本文介绍了是否可以删除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.

这篇关于是否可以删除mysql表排序规则?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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