1.今天搭建的mysql5.7.23环境,发现从5.6迁移函数的时候报错

ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
解决办法:
set global log_bin_trust_function_creators=1;

2.Mysql5.7 GTID 开启的情况下,从库同步报错跳过错误操作

未开启GTID的操作如下:

mysql>stop slave ;
mysql>SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1        #跳过一个事务
mysql>start slave 

开启GTID的操作如下:

mysql>select LAST_SEEN_TRANSACTION from performance_schema.replication_applier_status_by_worker;--获取事务号
+----------------------------------------+
| LAST_SEEN_TRANSACTION                  |
+----------------------------------------+
| 3925f080-d294-11e8-a4ce-00163e126c59:2 |
+----------------------------------------+

mysql>stop slave;
Query OK, 0 rows affected (0.00 sec)
mysql>set gtid_next='3925f080-d294-11e8-a4ce-00163e126c59:2';
Query OK, 0 rows affected (0.00 sec)
mysql>begin;
Query OK, 0 rows affected (0.00 sec)
mysql>commit;
Query OK, 0 rows affected (0.00 sec)
mysql>SET GTID_NEXT="AUTOMATIC";
Query OK, 0 rows affected (0.00 sec)
mysql>start slave;
Query OK, 0 rows affected, 1 warning (0.03 sec)

3.修改参数(不修改研发不同意)

explicit_defaults_for_timestamp参数修改:

因为默认这个参数是true如果表字段类似:
`WORK_DATE` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '参加工作日期'
insert的时候送 null就会报错,研发要求改,因为原来5.6版本默认是false
所以修改此参数
set global explicit_defaults_for_timestamp=false;-- (记得修改my.cnf)

sql_mode修改:
从'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'修改为'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION'

4.另外还有下问题:(mysql5.7默认sql模式问题)

1、某些GROUP BY的SQL语句无法执行了;
2、创建表时使用日期数据类型指定的默认值为0000-00-00时报错;
3、修改字段类型小于小于最长字段时报错。
解决办法参考:

http://www.ywnds.com/?p=8865