将Mysql Table列更改为区分大小写 [英] Altering Mysql Table column to be case sensitive

查看:87
本文介绍了将Mysql Table列更改为区分大小写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Mysql数据库中有一个表,该表用于身份验证.现在,我需要使身份验证区分大小写. 谷歌搜索时,我已经意识到Mysql列对于搜索操作是不区分大小写的(与Oracle相反),并且可以通过指定二进制"即创建表时更改默认行为.

I have a table in my Mysql database, which is used for authentication. And now, I need to make the authentication case sensitive. Googling around, I have realized Mysql columns are case insensitive (contrary to Oracle) for search operations and the default behavior can be changed while creating the table by specifying the "binary" ie.

CREATE TABLE USERS
(
    USER_ID SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
    USER_NAME VARCHAR(50) BINARY NOT NULL
)

有人可以告诉我如何在Mysql中更改表以将二进制"添加到数据库的现有列中吗?

Can someone please tell me how to alter the table in Mysql to add the "Binary" to an existing column of a DB?

谢谢!

推荐答案

ALTER TABLE USERS CHANGE USER_NAME USER_NAME VARCHAR(50) BINARY NOT NULL;

这篇关于将Mysql Table列更改为区分大小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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