MySQL Case-sensitive issues

Source: Internet
Author: User
Tags aliases

Originally Linux under the default is the table name is case-sensitive, with the following settings, you can let MySQL is not distinguished table name casing:
1, log in with root, modify/etc/my.cnf;
2. Add a line under the [MYSQLD] node: lower_case_table_names=1
3, restart MySQL can;

Where the Lower_case_table_names=1 parameter defaults to 1 in Windows, 0 in Unix, so there is no problem in window, and the reason for it to go down to Linux.

MySQL under Linux Database The name, table name, column name, and alias casing rules are as follows:

1. database name and table name are strictly case-sensitive

2. Table aliases are strictly case-sensitive

3. The alias of the column name and the column is case-insensitive in all cases

4. variable names are also strictly case-sensitive

MySQL is case insensitive under Windows

(1) keywords : Case insensitive SELECT * FROM table_name and select * FROM table_name effect is the same

(2) Identifiers (such as database name and table name): Case insensitive. If table uSers exists, the select * from Users and select * from users effect. Online says it's about the operating system, which is case-sensitive on all unit operating systems (except Mac OS that use hfs+) and is case-insensitive on Windows. (This statement on the Internet has not been verified, I am not case-sensitive on Windows server2003)
(3) Table Aliases : case-insensitive select m.* from users m where m.username = ' AA ';
(4) Alias for column : case-insensitive Select UName from (select Username as UName from users where id = 768)

MySQL Case-sensitive issues

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.