Mysql table names in linux/centos are case-insensitive.

Source: Internet
Author: User

Mysql table names in linux/centos 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.

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.

2. Add parameters to make them 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.

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.