完整的错误提示
-----------------------------------------WEB错误: -----------------------------------------
Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘t.DataTime’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘t.DataTime’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by] with root cause
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘t.DataTime’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
-----------------------------------------MySql错误:------------------------------------------------
[Warning] System table ‘time_zone_leap_second’ is expected to be transactional.
[Warning] System table ‘time_zone_name’ is expected to be transactional.
[Warning] System table ‘time_zone’ is expected to be transactional.
[Warning] System table ‘time_zone_transition_type’ is expected to be transactional.
[Warning] System table ‘time_zone_transition’ is expected to be transactional.
[Warning] System table ‘servers’ is expected to be transactional.
[Warning] Info table is not ready to be used. Table ‘mysql.slave_master_info’ cannot be opened.
[Warning] Info table is not ready to be used. Table ‘mysql.slave_relay_log_info’ cannot be opened.
[ERROR] Incorrect definition of table mysql.db: expected column ‘User’ at position 2 to have type char(32), found type char(16).
[ERROR] mysql.user has no Event_priv column at position 28
[ERROR] Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
产生的原因
当我的msql从5.5升级到5.7
解决办法(windows)
– 如果设置了环境变量,并且服务中指定了配置文件则直接修改启动参数的配置文件即可
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
– 未配置启动参数的mysql则先删除系统中的mysql service(因为服务注册了并不能直接增加配置文件)
mysqld --remove
– 注册使用配置文件启动的服务
mysqld --install MySql --defaults-file=“C:\MySql\my-default.ini”