Centos 7 mysql 5.7 表名忽略大小写

查看mysql的命令路径

which mysqld

效果:

root@jiang:/usr/local/whispers_cloud/whispers_cloud_api# which mysqld
/usr/local/mysql/bin/mysqld

查看mysql读取的默认配置文件位置

mysql --verbose --help | grep -A 1 'Default options'
root@jiang:~# mysql --verbose --help | grep -A 1 'Default options'
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf 
root@jiang:~#                                                                                

查看/etc/my.cnf 是否又配置:
已经是

root@jiang:/usr/local# egrep "lower_case_table_names" /etc/my.cnf       
root@jiang:/usr/local# 

不区分表名大小写

在[mysqld]下面加入

lower_case_table_names=1

查看/etc/my.cnf 是否又配置:

root@jiang:/usr/local# egrep "lower_case_table_names" /etc/my.cnf       
lower_case_table_names=1
root@jiang:/usr/local# 

重新启动mysql数据库

root@jiang:/usr/local# service mysqld restart
root@jiang:/usr/local# systemctl restart  mysqld 

你可能感兴趣的:(mysql)