默认情况下,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

转载于:https://www.cnblogs.com/liufofu/p/4141972.html

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐