一、表字段
1. Field “id” doesn't have a default value
解决方法:该表该字段改为自动递增。
二、触发器
1. Not allowed to return a result set from a trigger
创建触发器语句如下:
1 CREATE TRIGGER newproduct AFTER INSERT ON products 2 FOR EACH ROW SELECT 'Product added' ;
此时报错:
Not allowed to return a result set from a trigger
解决方法:加上 into @ee,因为从MySQL5以后不支持触发器返回结果集
1 CREATE TRIGGER newproduct AFTER INSERT ON products 2 FOR EACH ROW SELECT 'Product added' INTO @ee;