Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE tha

mysql在执行删除更新语句时报这种错误,是因为在mysql在safe-updates模式中,如果你where后跟的条件不是主键id,那么就会出现这种错误。

解决方式有两种

     1、SET SQL_SAFE_UPDATES = 0;执行该命令更改mysql数据库模式。

     2、在where判断条件中跟上主键id    例如:delete from firstmysqldatabase.user where UserName='zhangsan' and ID>=0;

     

猜你喜欢

转载自blog.csdn.net/qq_36742720/article/details/81515113