Are table names in MySQL case sensitive?
Are table names in MySQL case sensitive?
On my Windows dev machine the code I have is able to query my tables which appear to be all lowercase. When I deploy to the test server in our datacenter the table names appear to start with an uppercase letter.
The servers we use are all on Ubuntu.
In General:
Database and table names are not case sensitive in Windows, and case sensitive in most varieties of 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.
One can configure how tables names are stored on the disk using the system variable lower_case_table_names
. (in my.cnf configuration under [mysqld])
Read the section: 10.2.2 Identifier Case Sensitivity for more information.
Database and table names are not case sensitive in Windows, and case sensitive in most varieties of Unix or Linux.
to resolve the issue set the lower_case_table_names to 1
lower_case_table_names=1
this will make all your tables lowercase, no matter how you write them
MySQL中的表名是文件系统条目,所以如果底层文件系统是不区分大小写的。
链接地址: http://www.djcxy.com/p/69210.html上一篇: 查询中区分大小写的MySQL表名
下一篇: MySQL中的表名是否区分大小写?