Are table names in MySQL case sensitive?

后端 未结 5 690
半阙折子戏
半阙折子戏 2020-11-22 05:46

Are table names in MySQL case sensitive?

On my Windows development machine the code I have is able to query my tables which appear to be all lowercase. When I deploy

5条回答
  •  时光取名叫无心
    2020-11-22 06:13

    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 the my.cnf configuration file under [mysqld]).

    Read the section: 10.2.2 Identifier Case Sensitivity for more information.

提交回复
热议问题