设置mysql表名大小写不敏感
2013-09-13 11:57
260 查看
在跨平台的程序设计中要注意到mysql的一些系统变量在windows和linux上的缺省值是不同的, 比如mysql表名称的大小写变量.
在windows上lower_case_table_names变量的缺省值为1; 在linux上为0; 在mac os上为2;
该变量值的详细定义如下:
如果想在linux环境中想设置表名为大小写不敏感, 那么可以通过如下的命令:
mysqld --SET-lower_case_table_names=1;
或者在mysql server的配置文件中添加配置项:
vi /etc/my.cnf
[plain] view plaincopy
# The MySQL server
[mysqld]
set-variable=lower_case_table_names=1
iefreer
在windows上lower_case_table_names变量的缺省值为1; 在linux上为0; 在mac os上为2;
该变量值的详细定义如下:
Value | Meaning |
---|---|
0 | Table and database names are stored on disk using the lettercase specified in the CREATE TABLEor CREATE DATABASEstatement. Name comparisons are case sensitive. You should not set this variable to 0 if you are running MySQL on a system that has case-insensitive file names (such as Windows or Mac OS X). If you force this variable to 0 with --lower-case-table-names=0on a case-insensitive file system and access MyISAMtablenames using different lettercases, index corruption may result. |
1 | Table names are stored in lowercase on disk and name comparisons are not case sensitive. MySQL converts all table names to lowercase on storage and lookup. This behavior also applies to database names and table aliases. |
2 | Table and database names are stored on disk using the lettercase specified in the CREATE TABLEor CREATE DATABASEstatement, but MySQL converts them to lowercase on lookup. Name comparisons are not case sensitive. This works only on file systems that are not case sensitive! InnoDBtable names are stored in lowercase, as for lower_case_table_names=1. |
mysqld --SET-lower_case_table_names=1;
或者在mysql server的配置文件中添加配置项:
vi /etc/my.cnf
[plain] view plaincopy
# The MySQL server
[mysqld]
set-variable=lower_case_table_names=1
iefreer
相关文章推荐
- MySQL设置对数据库名、表名、变量名对大小写不敏感的方法
- mysql――设置mysql大小写不敏感
- mysql查询语句的大小写敏感设置
- MYSQL如何设置大小写不敏感
- 设置mysql表名大小写不敏感
- MySQL的大小写敏感设置
- mysql 设置大小写不敏感
- MySQL5.6设置Win下设置大小写敏感
- 设置mysql表名大小写不敏感
- mysql 表名大小写敏感设置
- MySql设置表名大小写不敏感
- mysql中table名称大小写敏感的设置
- mysql 大小写取消敏感设置
- Mysql大小写敏感
- mysql对表名大小写不敏感
- SQL Server 2005大小写敏感设置
- mysql大小写敏感问题
- MySQL表名不区分大小写的设置方法
- MYSQL的binary解决mysql数据大小写敏感问题的方法|Blob与Text的区别-【mysql学习笔记】
- MySQL大小写敏感说明