Question

I can't find a reference about which part of a MySQL query is case sensitive.

Is there an overview of where capitalization matters?

Specifically, are any of these case sensitive:

  • database name
  • table name
  • column name

Is it tied to the OS? Configurable? Or some other combination of factors?

Was it helpful?

Solution

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 (and possibly more, depending on the storage engine). Consequently, the case sensitivity of the underlying operating system plays a part in the case sensitivity of database and table names. This means database and table names are not case sensitive in Windows, and case sensitive in most varieties of Unix.

.

The lower_case_table_names system variable also affects how the server handles identifier case sensitivity

You can read more about the topic here.

OTHER TIPS

It depends on the collation. For example if your table has unicode_general_ci, it'll support general unicode character recognizing algorithm and it'll be case-*in*sensitive.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top