LOWER(str) Returns the string str with all characters changed to lowercase according to the current character set mapping. The default is latin1 (cp1252 West European). mysql> SELECT LOWER('QUADRATICALLY'); -> 'quadratically'LOWER() (and UPPER()) are ineffective when applied to binary strings (BINARY, VARBINARY, BLOB). To perform lettercase conversion, convert the string to a nonbinary string: mysql> SET @str = BINARY 'New York'; mysql> SELECT LOWER(@str), LOWER(CONVERT(@str USING latin1)); +-------------+-----------------------------------+ | LOWER(@str) | LOWER(CONVERT(@str USING latin1)) | +-------------+-----------------------------------+ | New York | new york | +-------------+-----------------------------------+
-> 'quadratically'LOWER() (and UPPER()) are ineffective when applied to binary strings (BINARY, VARBINARY, BLOB). To perform lettercase conversion, convert the string to a nonbinary string: mysql> SET @str = BINARY 'New York';
mysql> SELECT LOWER(@str), LOWER(CONVERT(@str USING latin1));
+-------------+-----------------------------------+
| LOWER(@str) | LOWER(CONVERT(@str USING latin1)) |
+-------------+-----------------------------------+
| New York | new york |
+-------------+-----------------------------------+
mysql> SELECT LOWER('ZhangShan') lower_str,LCASE('LiShi') lcase_str;
+-----------+-----------+
| lower_str | lcase_str |
+-----------+-----------+
| zhangshan | lishi |
+-----------+-----------+
1 row in set (0.00 sec)mysql>
2,在my.cnf文件里面,设置 lower_case_table_names,然后重启db,不过这样会影响一些业务,不太推荐。