默认情况下,mysql在创建数据库对象时,是区分大小写的。故与microsoft之间进行移植时,要特别注意是否存在问题。在mysql中大小写与参数lower_case_table_names有很大关系。
以下为官方解释:
If set to 0, table names are stored as specified and comparisons are case sensitive. If set to 1, table names are stored in lowercase on disk and comparisons are not case sensitive. If set to 2, table names are stored as given but compared in lowercase. This option also applies to database names and table aliases.
当设置为0时,存储和比较都是大小写敏感的;当设置为1是存储时会转换为小写,比较时不区分大小写;当设置为2时候,存储时区分大小写,比较的时与转换为小写。此选项对数据库名和数据表名起作用。
lower_case_table_names是个只读变量,不能直接设置生效,必须在配置文件中设置并重启mysqld服务。
mysql> set lower_case_table_names=1;
ERROR 1238 (HY000): Variable ‘lower_case_table_names’ is a read only variable