Because the MySQL database directly corresponds to the data directory, and the table, the trigger corresponds to the files in the directory, so that the MySQL identifier is case sensitive not only related to the operating system, but also with what kind of object is related.
By default, MySQL is case sensitive:
- Field name, field alias, index name, stored procedure name ..., as long as no directories and files are involved, no platform is case-sensitive;
- Windows platform, database name, table name, table alias, trigger name, and so on, not case-sensitive;
- Unix, Linux Platform, database name, table name, table alias, trigger name, etc., it is necessary to distinguish the case;
- Log file group name, is also case-sensitive, this general situation is not many people concerned;
- Variable names are strictly case-sensitive.
There are usually two ways to prevent the same code from appearing abnormally on different platforms:
- Statements involving databases, tables, and triggers are all lowercase;
- In the [mysqld] section of My.ini, add "lower_case_table_names=1".
By the way, the situation of other databases:
- Oracle: Default is case insensitive, table names, field names, etc. are case-insensitive, lowercase letters are automatically converted to uppercase letters, and double quotes are required when using lowercase letters.
- PostgreSQL: The default is case insensitive, table names, field names, etc. are case-insensitive, uppercase letters are automatically converted to lowercase letters (just as opposed to Oracle), and you need to use double quotes when using uppercase letters.
- SQL Server: default is case insensitive; You can change the collation by modifying it.
About MySQL is case sensitive