About MySQL is case sensitive

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.