Are table names in MySQL case sensitive?

后端 未结 5 697
半阙折子戏
半阙折子戏 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:16

    It depends upon lower_case_table_names system variable:

    show variables where Variable_name='lower_case_table_names'
    

    There are three possible values for this:

    • 0 - lettercase specified in the CREATE TABLE or CREATE DATABASE statement. Name comparisons are case sensitive.
    • 1 - Table names are stored in lowercase on disk and name comparisons are not case sensitive.
    • 2 - lettercase specified in the CREATE TABLE or CREATE DATABASE statement, but MySQL converts them to lowercase on lookup. Name comparisons are not case sensitive.

    Documentation

提交回复
热议问题