Mysql Case sensitivity

Source: Internet
Author: User

Mysql Case sensitivity
Problem:

When you create a mysql table, whether it is in upper or lower case, it is changed to lower case after the table is created.

Cause:

MySQL is case-insensitive in windows. After the script file is imported into MySQL, the table name is automatically converted to lowercase.

Solution: (based on the windows System)

Find the my. ini file in the mysql installation directory and add it to the file (1 indicates case insensitive and 2 indicates case sensitive)

1 lower_case_table_names = 2

Restart mysql and run the following command on the cmd command line:

1 net stop mysql2 net start mysql

 

Then, on the mysql command interface, enter:

Show variables like '% low % ';

 

It is case sensitive.

In addition, when you use Navcat to execute an SQL script, you may also encounter a problem: it is clear that all script statements are executed with uppercase table names, but after the script is created, some table names have been changed to lower-case format.

For example: (the reason why a strange lowercase table name suddenly appears in all upper-case tables is unknown)

Solution,

1. Manually use the command to change.

1 rename table t_meeting to t_m; 2 rename table t_m to T_MEETING;

 

2. Find the data file and rename it directly:

File Path: C: \ ProgramData \ MySQL Server 5.5 \ data

Find the corresponding database and rename the corresponding table, because the Navcat rename seems to have no effect, it may be a problem with my version, so it is not recommended to directly use Navcat to modify it.

================

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.