MySQL table names in Linux are case-insensitive.

Source: Internet
Author: User

MySQL table names in Linux are case-insensitive.

Scenario: Recently, the company switched the database from Oracle to MySQL. Since the table names in Oracle are case insensitive, the problem of table names not found in MySQL occurs, it is found that MySQL table names in Linux are case-sensitive, but some parameters can make them case-insensitive. The procedure is as follows:

I. MySQL Case details in Linux:
1. Database names are case sensitive
2. The table name is case sensitive.
3. Table aliases are case sensitive.
4. Variable names are case sensitive
5. The column names are case-insensitive in all cases.
6. The column alias is case-insensitive in all cases.

Ii. Set the MySQL table name to be case insensitive
1. Switch to the root user
$ Su-root

2. Modify the/etc/my. cof configuration file,
# Sed-I '/mysqld/a \ lower_case_table_names = 1'/etc/my. cnf

Lower_case_table_names parameters:

  • 0: Case Sensitive
  • 1: case insensitive

3. Restart MySQL
# Service mysqld restart

4. View mqsql Parameters
# Mysql-uroot-p
> Show variables like "% case % ";
+ ------------------------ + ------- +
| Variable_name | Value |
+ ------------------------ + ------- +
| Lower_case_file_system | OFF |
| Lower_case_table_names | 1 |
+ ------------------------ + ------- +
2 rows in set (0.00 sec)

Iii. Others

In Windows, MySQL is always case-insensitive.

This article permanently updates the link address:

Related Article

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.