您的位置:首页 > 数据库 > MySQL

MySQL表名 区分大小写

2015-11-24 11:00 597 查看
官方文档说的很清楚 嘿嘿

lower_case_table_names


Command-Line Format	--lower_case_table_names[=#]
System Variable	Name	lower_case_table_names
Variable Scope	Global
Dynamic Variable	No
Permitted Values	Type	integer
Default	0
Min Value	0
Max Value	2

If set to 0, table names are stored as specified and comparisons are case sensitive. If set to 1, table names are stored in lowercase on disk and
comparisons are not case sensitive. If set to 2, table names are stored as given but compared in lowercase. This option also applies to database
names and table aliases. For additional information, see Section 9.2.2, “Identifier Case Sensitivity”.

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 OS X). If you
set this variable to 0 on such a system and access MyISAM tablenames using different lettercases, index corruption may result. On Windows the
default value is 1. On OS X, the default value is 2.

If you are using InnoDB tables, you should set this variable to 1 on all platforms to force names to be converted to lowercase.

The setting of this variable has no effect on replication filtering options. This is a known issue which is fixed in MySQL 5.6. See Section 17.2.3,
“How Servers Evaluate Replication Filtering Rules”, for more information.

You should not use different settings for lower_case_table_names on replication masters and slaves. In particular, you should not do this when the
slave uses a case-sensitive file system, as this can cause replication to fail. This is a known issue which is fixed in MySQL 5.6. For more information,
see Section 17.4.1.36, “Replication and Variables”.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: