Home > Database > Mysql Tutorial > mysql不区分大小写(大小写不敏感)_MySQL

mysql不区分大小写(大小写不敏感)_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:01:55
Original
1387 people have browsed it

下边用一张表来区分mysql在windows和linux默认情况下对大小写的敏感程度

操作系统 表名 变量名 字段值
windows 不敏感 不敏感 不敏感
linux 敏感 敏感 敏感

linux下先不做介绍,因为没有实际用过,下边说下在windows下的修改方法:

表名区分大小写改法:

lower_case_table_names = 0
其中 0:区分大小写,1:不区分大小写

字段值的改法:

1、 创建时设置: CREATE TABLE T(
A VARCHAR(10) BINARY );
2、 使用alter修改:
ALTER TABLE `tablename` MODIFY COLUMN `cloname` VARCHAR(45) BINARY;

3、使用数据库管理工具改

注意事项:不能通过直接改table的Collection为bin(如果数据库字符编码属性为utf-8则为utf8_bin)来使所有字段都生效,必须一个字段一个字段的改

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template