事情起源于些课后习题p89页的操作
(5)在teacherinfo1表中,将性别为“男”的记录的家庭住址都改为“上海市浦东新区”。
update teacherinfo1
set tadress='上海市浦东新区'
where tcsex='男';
select *from teacherinfo1;
出现了以下截图的错误
经过百度发现(https://www.cnblogs.com/xuwinwin/p/15845325.html)
MySQL系统默认的模式为safe-updates,在该模式下,会导致非主键条件下无法执行update或者delete命令
所以我们通过以下语句:
将safe_updates模式关闭
便可解决此问题