Configurations that need to be paid attention to when installing Mysql in Linux

Configurations that need to be paid attention to when installing Mysql in Linux

1. The database modification in Linux ignores the case of the table name

1.vi /etc/my.cnf

2.因为linux下mysql默认是要区分表名大小写的。mysql是否区分大小写设置是由参数lower_case_table_names决定的,
安装后默认lower_case_table_names = 0 为区分大小写;
如果需要忽略大小写设置lower_case_table_names = 1即可

3.重启mysql服务 systemctl restart mysqld

2、Liuux中解决GroupBy异常–Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column ‘xxxx’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

原因:mysql 5.7+中 默认启用了 ONLY_FULL_GROUP_BY
这个表示什么呢,从字面上看,大概就是一种严谨的SQL模式,类似于Oracel那些Group by语句;
处理方式为去掉这个模式

1.vi /etc/my.cnf

[mysqld] 
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

2.重启mysql服务 systemctl restart mysqld

image-20230506145229155

Solve the problem of GroupBy exception in Mysql under Linux

Guess you like

Origin blog.csdn.net/weixin_45285213/article/details/130527489