mysql 字段區分大小寫

2021-09-25 08:33:26 字數 441 閱讀 6142

預設情況下, mysql中的字段是不區分大小寫的,所以"aa"與"aa"被認為是一樣的。

那麼有些特殊情況下,我們希望它區分大小寫呢,這時應該怎麼辦,說出來其實很簡單,如:

drop table if exists `tpl_forbiddenword`;

create table `tpl_forbiddenword` (

`id` int(11) not null auto_increment,

`word` varchar(32) binary not null comment '遮蔽詞',

primary key (`id`),

unique key `word` (`word`) using btree

) engine=innodb default charset=utf8mb4;

".

mysql 字段區分大小寫

預設情況下,mysql中的字段是不區分大小寫的,所以 aa 與 aa 被認為是一樣的。那麼有些特殊情況下,我們希望它區分大小寫呢,這時應該怎麼辦,說出來其實很簡單,如 drop table if exists tpl forbiddenword create table tpl forbiddenw...

MYSQL 區分大小寫

1 linux下mysql安裝完後是預設 區分表名的大小寫,不區分列名的大小寫 2 用root帳號登入後,在 etc my.cnf 中的 mysqld 後新增新增lower case table names 1,重啟mysql服務,這時已設定成功 不區分表名的大小寫 lower case table...

mysql區分大小寫

兩種情況下會區分大小寫,1 建表時,表的編碼是utf8 bin utf8 general ci不會區分大小寫 注意是表編碼不是資料庫編碼。區分大小寫與資料庫編碼無關。2 建表後,可以通過 binary調整。語句如下 alter table wl testdx bin wlt testdx bin m...