默认情况下,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;
本文解析了MySQL中表名和数据库名的大小写敏感性配置,详细介绍了lower_case_table_names参数的三个设置选项及其影响。该参数决定了数据库对象在存储和比较时的大小写处理方式,对于跨平台移植尤为重要。
193

被折叠的 条评论
为什么被折叠?



