In MySQL, the database corresponds to the directory in the operating system data directory, and each table in the database corresponds to at least one file in the database directory (or possibly multiple, depending on the storage engine). Therefore, the case sensitivity of the operating system used determines the database name and the case sensitivity of the table name. This means that in most Unix, database names and table names are case-sensitive and case insensitive in Windows.
columns, indexes, stored subroutines, and trigger names are not case sensitive on any platform, and the alias of the column is not sensitive.
For Unix-like systems:
Database name and table name are strictly case-sensitive
Table aliases are strictly case-sensitive
Column names and column aliases are case-insensitive in all cases
Variable names are also strictly case-sensitive
For win systems:
How MySQL saves and uses the table name and database name on the hard disk is determined by the LOWER_CASE_TABLES_NAME system variable and can be set when the mysqld is started.
If set to 0, table names is stored as specified and comparisons is case sensitive.
If set to 1, table names is stored in lowercase on disk and comparisons is not case sensitive.
If set to 2, table names is stored as given but compared in lowercase. This option also applies to database names and table aliases.
Default lower_case_tables_name=0 on UNIX platforms
MySQL is also case insensitive when querying or string comparisons. You can specify the binary keyword to match the case.
If you use MySQL on only one platform, you typically do not need to change the lower_case_tables_name variable. However, if you want to transfer tables between platforms that are sensitive to the size of different file systems, you will encounter problems.
Naming conventions
In order to avoid case-based problems, a recommended naming convention is to define the database/table/column with all lowercase letters + underscores, without using any uppercase letters.
If you use the InnoDB engine, apply lower_case_tables_name=1 on any platform to force the name to lowercase. Please note that before restarting Mysqld, the original database name and the table name must all be converted to lowercase before lower_case_tables_name is set to 1 in the UNIX system.
This article is from the "Share Your Knowledge" blog, so be sure to keep this source http://skypegnu1.blog.51cto.com/8991766/1591571
MySQL database name, table name capitalization problem