MySQL 中的表名区分大小写吗?
在我的 Windows 开发机器上,我拥有的代码能够查询我的表,这些表似乎都是小写的。当我部署到数据中心的测试服务器时,表名称似乎以大写字母开头。
我们使用的服务器都在Ubuntu上。
最佳答案
一般来说:
数据库和表名称在 Windows 中不区分大小写,但在大多数 Unix 版本中区分大小写。
In MySQL, databases correspond to directories within the data directory. Each table within a database corresponds to at least one file within the database directory. Consequently, the case sensitivity of the underlying operating system plays a part in the case sensitivity of database and table names.
可以使用系统变量lower_case_table_names
(在[mysqld]下的my.cnf配置文件中)配置表名称在磁盘上的存储方式。
阅读该部分:10.2.2 Identifier Case Sensitivity了解更多信息。
关于mysql - MySQL中的表名区分大小写吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41516160/