One, 1 CREATE TABLE name (name VARCHAR (10));
For this table, by default, the results of the following two queries are the same:
The
code is as follows:
SELECT * from TABLE NAME WHERE name= ' clip ';
SELECT * from TABLE NAME WHERE name= ' Clip ';
MySQL default query is case-insensitive, if you need to distinguish between him, must be in the table, binary marked sensitive properties.
The
code is as follows:
CREATE TABLE NAME (
name VARCHAR (Ten) BINARY
);
2 Implement SELECT * from TABLE NAME where BINARY name= ' Clip ' in SQL statement;
3 Setting the character set:
UTF8_GENERAL_CI--Case insensitive
utf8_bin--Case Sensitive
Second, MySQL is not case-sensitive under Windows, the script file into MySQL after the table name will automatically be converted to lowercase, and then want to put the database export to the Linux server to use when the error. Because in Linux the table name is case-sensitive and cannot find a table, many of them are said to change the MySQL settings under Linux so that it is not case-sensitive, but there is no way to turn to the case of Windows sensitivity. In fact, the method is the same, the corresponding change in Windows MySQL settings on the line.
Specific actions:
Add a row to the MySQL profile My.ini:
Lower_case_table_names = 0
0: Case-sensitive, 1: case-insensitive
MySQL under Linux database name, table name, column name, alias capitalization rule is this:
1, the database name and table name is strictly case-sensitive case;
2, the alias of the table is strictly case-sensitive;
3, column name and column alias in all cases are ignored case;
4, the variable name is also strictly case-sensitive; MySQL is case-insensitive under windows
The above is the entire content of this article, I hope you can enjoy.