mysql的时区错误问题以及Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre的问题
第一个问题:The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone....
解决方案:
一、使用cmd命令查询time_zone并且给他+上8:00
1、首先先进入cmd然后进入mysql(进入mysql的指令就不说了)
2、输入show variables like '%time_zone%';
3、输入set global time_zone='+8:00';
效果图如下:
二、在mysql里的my.ini配置文件里添加一条default-time-zone = '+8:00'
然后重启mysql就搞定啦~命令方式可以不用重启
提示:修改配置文件方式需放在[mysqld]之下,否则无效!
————————————————————————————————————————————————————————
第二个问题:Expression #2 of SELECT list is not in GROUP BY clause and contains
nonaggregated column ‘sss.month_id’ which is not functionally
dependent on columns in GROUP BY clause; this is incompatible with
sql_mode=only_full_group_by
之前试过很多命令方法最后都不是很管用,最后自己看着博客自己修改配置文件弄好的。
方法就是:在mysql文件中找到my.ini配置文件,在配置文件最后面加上
[mysqld]
sql_mode=NO_AUTO_VALUE_ON_ZERO,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE
然后重启mysql服务就好啦~