How to set MySQL database name and table name in windows and linux _ MySQL

Source: Internet
Author: User
Database and table names are case-insensitive in Windows, while they are case-sensitive in most types of UnixLinux systems. So how can we deal with this problem? after some queries, we found that the lower_case_table_names parameter can be case sensitive in MySQL, and databases and tables are actually directories and files under the Data Directory.

Therefore, the sensitivity of the operating system determines the case sensitivity of the database and table names. This means that the database and table names are case-insensitive in Windows and are case-sensitive in most types of Unix/Linux systems.

MySQL is case sensitive and can be controlled by the lower_case_table_names parameter in the configuration file.

WINDOWS:

Edit my. ini file, add lower_case_table_names = 0 under [mysqld] (Note: When it is 0, it is lowercase sensitive; when it is 1, it is lowercase insensitive; the default value is 1 ), mySql can define the table name according to the case-insensitive state of the SQL statement for table creation.

LINUX:

Edit/etc/my. in the cnf file, add the lower_case_table_names parameter in the [mysqld] section and set the corresponding value (Note: When the value is 0, it is lowercase sensitive; when the value is 1, it is lowercase insensitive; the default value is 0)

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.