MySQL在windows下是不区分大小写的,将脚本导入MySQL后表名也会自动转化为小写;如果在SQL中对表名使用了大写形式,则执行会报错,找不到数据表。
解决办法:
(1) 打开 my.ini 文件
(2) 找到 [mysqld] ,在其下面增加 lower_case_table_names 参数
# The MySQL server
[mysqld]
lower_case_table_names = 2
(3) 重启Mysql服务
官方对lower_case_table_names参数的说明:
How table and database names are stored on disk and used in MySQL is
affected by the lower_case_table_names system variable, which you can
set when starting mysqld. lower_case_table_names can take the values
shown in the following table. This variable does not affect case
sensitivity of trigger identifiers. On Unix, the default value of
lower_case_table_names is 0. On Windows, the default value is 1. On OS
X, the default value is 2.
具体每项值所表示的意义,可参见官方说明文档
References