mysql设置大小写敏感
什么是大小写敏感
lower_case_table_names值为1的时候,查询mysql会自动将查询的表小写化。为0的时候,会去查询大写的表。
修改配置
如果不知道,可以用find查找
# find / -name my.cnf
# vim /etc/my.cnf
添加如下内容
# 大小写敏感 1表示 不敏感 默认为0
lower_case_table_names=1
重启mysql
lnmp restart
查看
mysql> show variables like "%case%";
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| lower_case_file_system | OFF |
| lower_case_table_names | 0 |
+------------------------+-------+
2 rows in set (0.00 sec)
mysql> show variables like "%case%";
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| lower_case_file_system | OFF |
| lower_case_table_names | 1 |
+------------------------+-------+
2 rows in set (0.00 sec)